webrtc-tunnel
webrtc-tunnel copied to clipboard
use WebRTC to create tunnels even when peers are behind NAT
WebRTC Tunnel
WebRTC uses ICE to connect to remote peers, which supports NAT traversal pretty well.
WebRTC is a peer-to-peer protocol but this script assigns one peer as server and the other as client, and creates an SOCKS5 proxy on server.
Install
- Clone this repository.
- Run
npm install
Run
server
npm run server
You will see a server ID at end.
client
npm run client -- <serverId>
Set SOCKS5 proxy to 127.0.0.1:1082
.
Thanks
This project used to use gladkikhartem/koshare-router as WebRTC signaling server.
The original server had been shut down, so I created my own implementation at yume-chan/koshare-router-nodejs.
Note on pnpm
Usually I use pnpm to install npm packages.
But due to it doesn't support bundledDependencies
, it can't be used to install the most important dependency of this project, wrtc.
So this project uses npm
directly.