This is a proxy server that tunnels traffic through socket.io connections. It has 2 parts: a local proxy server (handles socks & http) and a remote socket.io server (relays traffic).
Edit .env file with your settings:
LOCAL_PROXY_PORT - local proxy port (for your machine)
REMOTE_SERVER_URL - remote socket.io server url (use https)
REMOTE_SERVER_PORT - remote server port
AUTH_TOKEN - token for socket.io authorization (keep it secret)
CERT - path to ssl certificate (optional)
PRIVATE_KEY - path to ssl private key (optional)
REJECT_UNAUTHORIZED - set to 'false' to allow self-signed certificates (default: 'true')yarnRun the local proxy server
yarn local
# or
node src/local.js
# or
pm2 start src/local.js --name proxy-serverRun the socket.io server
yarn remote
# or
node src/remote.js
# or
pm2 start src/remote.js --name socket.io-serverIf you need SSL certificates for your remote server (for https), you can generate self-signed ones:
yarn gen-cert
# or
npm run gen-certThis creates server.crt and private.key files in your current directory. Then set in .env:
CERT=./server.crt
PRIVATE_KEY=./private.key
REJECT_UNAUTHORIZED=false- Local proxy runs on your machine
- Remote socket.io server runs on your server
- They connect through socket.io (websockets)
- Your traffic goes: App → Local proxy → Socket.io tunnel → Remote server → Internet
- Responses come back the same way
- Make sure both servers are running
- Use https for REMOTE_SERVER_URL if possible
- Check your firewall settings on remote server
- Set the same AUTH_TOKEN on both sides for secure connections
- SSL certificates (CERT / PRIVATE_KEY) are only needed if you run https directly
- When using self-signed certificates, set REJECT_UNAUTHORIZED=false to avoid connection errors