ws-proxy
provide http proxy under web socket
High Level Design
Example
an example proxy server with client
server
import http from "http";
import { ProxyServer } from "../src/server";
const SERVER_PORT = 10032;
const server = http.createServer();
new ProxyServer({ server });
server.listen(SERVER_PORT);
client
import http from "http";
import { ProxyClient } from "../src/client";
const SERVER_PORT = 10032;
const CLIENT_PORT = 50001;
const client = new ProxyClient(
`ws://server.host.com:${SERVER_PORT}`,
CLIENT_PORT
);
client.ready().then(()=>{
console.log("proxy ready")
});
// http proxy ready on http://127.0.0.1:50001