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

Proposal: HTTP and TCP Tunneling #142

Open
EternityForest opened this issue Jul 12, 2023 · 4 comments
Open

Proposal: HTTP and TCP Tunneling #142

EternityForest opened this issue Jul 12, 2023 · 4 comments

Comments

@EternityForest
Copy link

Right now, self hosted software cannot be fully automated well without being bound to some cloud service, due to the need for certificates, DNS, and firewall ports.

There is clearly a lot of interest in things like ngrok, and a P2P alternative would have many use cases.

I'm suggesting a standardized way to make a local service accessible over the web, in the same way torrents currently make files accessible.

In your torrent client, you would create a Webservice Torrent, that connects to a specific local port. This would produce a torrent file and public key hash, placed on the DHT as an updatable value under that key.

On the client side, one would import that torrent and be prompted to select a port on the client machine. The service would be tunneled to appear as if it were on the clients localhost on that port. The client software would periodically update the torrent file by looking on the DHT.

Alternatively, if the service is HTTP, the client could visit HASH.localhost, and the client software would intercept the header, and automatically set up an ephemeral tunnel for that connection, so that one could share links like regular URLs.

All communication could be done via TLS, with the server certificate self signed, and embedded right in the the torrent.

Similarly, the servers WAN IPs would be embedded in the torrent file for instant setup.

This would allow for just about any service to be self hosted in only a few clicks provided the client had the app, greatly simplifying IoT.

@ckcr4lyf
Copy link

ckcr4lyf commented Sep 7, 2023

There is clearly a lot of interest in things like ngrok, and a P2P alternative would have many use cases.

Could you explain a bit more as to how what you're describing achieves this?

E.g. let's say Bob (Public IP = 1.2.3.4) is running a webserver on localhost:3000 . He then prepares a "webservice torrent" for this.

If Alice (Public IP = 8.8.8.8) wants to access this, she would acquire the "webservice torrent" (for simplicity let's just assume Bob emails it to her), add it to her client, and select a port e.g. 4444.

Are you saying that now Alice's localhost:4444 would be tunneled to Bob's service running on his localhost:3000?

@EternityForest
Copy link
Author

EternityForest commented Sep 7, 2023 via email

@ckcr4lyf
Copy link

ckcr4lyf commented Sep 7, 2023

Well, where does the TCP connection happen then? I.e. how does a packet from Alice's computer (localhost:4444) get to Bob's service (i.e. his localhost:3000)?

ngrok etc. solve the problem of needing to open ports by basically making a reverse tunnel, and they forward traffic on a Public IP with an open port that they have.

I'm not sure I quite understand how Bob's service would be exposed for others to connect to over the internet, assuming he doesn't manually open any ports.

Even BitTorrent behind an ISP which doesn't let you port-forward would only allow outgoing connections, so I don't see how torrents would solve it in a ngrok like manner.

@EternityForest
Copy link
Author

EternityForest commented Sep 7, 2023 via email

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

2 participants