Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Permit reverse proxy #41

Open
chrisjd20 opened this issue Sep 16, 2021 · 2 comments
Open

Feature Request: Permit reverse proxy #41

chrisjd20 opened this issue Sep 16, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@chrisjd20
Copy link

So this is a great program. But what I would love is a reverse socks tunnel feature. So that you could have a client connect to a server and bind a local port on the server to listen and tunnel into the client's network. This is great if you have a client that doesnt have a public IP but you need to be able to reach into it's network. This is equivalent to ssh's -R option:

ssh -R 9050 [email protected]
@genshen
Copy link
Owner

genshen commented Sep 16, 2021

Currently, wssocks indeed does not support reverse proxy directly.
But wssocks+ssh can be a workaround.
Consider you have a web service on the client (at port :9050), and server has a public IP (e.g. pub.server.com).

In traditional approach, if client can connect to server via ssh directly, we can use ssh -R, just like:

client_host$ ssh -NR pub.server.com:9051:localhost:9050 [email protected]

Then, we can access client's web service via curl http://pub.server.com:9051/.

If client can not connect to server via ssh directly (but can connect using wssocks), then the ssh reverse proxy can be changed to:

client_host$ ssh -o ProxyCommand='nc -x 127.0.0.1:1080 %h %p' -NR pub.server.com:9051:localhost:9050 [email protected]

(where port :1080 above is wssocks client's port for data forwarding)

May this workaround can help you.

Native reverse proxy support of wssocks can be a really useful feature, I would consider to implement it.

@chrisjd20
Copy link
Author

Thats definitely a possible work around but not on Windows system with specific restrictions.

@genshen genshen added the enhancement New feature or request label Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants