Helps developers to reverse proxy their localhost via socket.io on on aws, heroku or any server can run node.js Uses socket.io to make a one way reverse proxy
- any cloud or dedicated server can run Node.js installed with Reverse proxy publisher server (which is going to be our publicly reachable server)
- a Reverse proxy backend server (which is make a connection from localhost to proxy server and serve our localhost)
This project works with a Reverse proxy backend server
Sample Publisher Server Code:
const proxyServer = require('socket-io-reverse-proxy-server')
const proxyPublisherServer = proxyServer({
secretKey:"very_secret_key"
})
proxyPublisherServer.listen(80,(e)=>{
console.log("Proxy Publisher server running and waiting for socket-io-proxy-backend's connection.")
})
Sample Localhost Server Code:
const proxyBackend = require('socket-io-proxy-backend')
const proxyBackendClient = proxyBackend({
//its your localhost
server :"http://localhost",//its default
port : 80, //its default
//secret key for authentication with proxy publisher server
secretKey: "very_secret_key",
})
//Publish localhost to cloud
const socket = proxyBackendClient.publish({
//its your cloud server
server : "http://ec2-3-120-246-199.eu-central-1.compute.amazonaws.com/", // our cloud server's publicly reachable address
port : 80 //its default
})
// with npm
npm install socket-io-reverse-proxy-server