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

Add SCOKS5 support? #58

Open
mStirner opened this issue Jun 19, 2024 · 0 comments
Open

Add SCOKS5 support? #58

mStirner opened this issue Jun 19, 2024 · 0 comments

Comments

@mStirner
Copy link
Member

mStirner commented Jun 19, 2024

Instead of this websocket open/close stuff, implmenet in the backend a socks5 server, and forward this to client where the needed actions are done?

But for every connection, there needs to be a tunnel to forward connect requests (like tcp connections). So is sockes impelmentation #54 with extra steps?

Doing so sets the requirement that a system wide proxy for the backend can be set, that no specific (http) agents need to be set and a simple http request to a internal LAN ip works out of the box: e.g.:

const http = require("http");
http.request("http://192.168.21.52")

The http request made in the backend is forwarded to the LAN that the connector runs in.

  1. HTTP Client request
  2. OS init socks5 session, tcp socket create to socks5 server (backend)
  3. socks5 server froward request to connector
  4. connector creates websocket connection to backend, which is used as underlaying network socket
  5. socks5 server (backend) tells client "ok, send data"
  6. HTTP Client request sends over sockets->websocket->connector->LAN target

With the flow above, even listener (forwareder) can be create from within the backend without any special configration on the lan/connector side. (0x02 = bindet einen Port¹)

To forward all traffic/sockets create in the backend/node.js process:

image
https://unix.stackexchange.com/q/71481

The sockets5 protocol seems pretty simple.
Some demo/reference implementations:

Now the final question: What benefit do we gain from this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant