@newdash/ws-proxy
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

ws-proxy

npm (scoped) node-test codecov

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

CHANGELOG

LICENSE

Readme

Keywords

none

Package Sidebar

Install

npm i @newdash/ws-proxy

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

581 kB

Total Files

24

Last publish

Collaborators

  • suntao