1.0.4 • Published 2 years ago

@newdash/ws-proxy v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ws-proxy

npm (scoped) node-test codecov

provide http proxy under web socket

High Level Design

npm.io

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

CHANGELOG

LICENSE

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

0.0.3

3 years ago