-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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] Could you add a "port forwarding" example? #324
Comments
There is one example based on ZeroTier: https://github.com/selvakn/p2p-port-forward But p2p-port-forward sometimes crash with "double free or corruption (fasttop)". |
There is one based on Tox: https://github.com/gjedeer/tuntox |
Hey @diyism , it should be pretty straight forward to port-forward (or tunnel) something using https://github.com/hsanjuan/go-libp2p-gostream Just like they do here: https://zupzup.org/go-port-forwarding/ but using the Dial and Listen provided by go-libp2p-gostream as you see fit. i.e.: Client
Server
Hope it helps |
IPFS has experimental commands to tunnel tcp stream: If the IPFS peer tcp tunnel can be built on go-libp2p-kcp finally, the tunnel will be perfect in performance: |
What a pity, ipfs p2p TCP tunnel breaks after every request: ipfs/kubo#5032 |
It's being fixed: ipfs/kubo#4929 |
We're also going to start work on a libp2p "daemon" in the near future so you don't have to run a full go-ipfs node. |
Great, "ipfs p2p forward" works very well in ipfs v0.12.1 now. |
@diyism You might want to check out the performance compared to https://github.com/hyprspace/hyprspace, they had an update which significantly boosted bandwidth performance which would be good to compare against |
I've tested hyperspace, its bandwith is about 0.6MB/s from china to southkorea, it's same to the bandwidth of "ipfs p2p forwarding", so currently, it seems there's no advantage compared to ipfs p2p currently. |
Ah I see, seems |
@diyism Extended the proxy sample to support HTTP/HTTPS tunneling over libp2p. Check the sample here: |
Great, I've test it, the http proxy of your portforward-over-libp2p is OK, it's very convenient, thanks. |
@dvasanth note the existence of https://github.com/libp2p/go-libp2p-http, which you could just wrap. |
Could you do me a favor to add a "port forwarding" example?
Currently only there is a "http-proxy" example(https://github.com/libp2p/go-libp2p/tree/master/examples/http-proxy)
If we have "port forwarding" example, we can port-forward to any service port, for example sniproxy, nginx etc.
Edit:
#324 (comment)
The text was updated successfully, but these errors were encountered: