1.0.4 • Published 3 years ago

websockify.js v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

websockify.js

A websockify written in javascript, But with 2 Converting Method.

API

module.tcp

A function that convert TCP into WS. There's a required parameter's:

  • targetObject A TCP Server target to convert to
  • forwardToObject A websocket new WebSocket(....).

Example

const { tcp } = require('websockify.js');

tcp({
	hostname: 'localhost',
	port: 8080
}, { port: 9090 });
// Now forwarding tcp://localhost:8080 to ws://localhost:9090

module.ws

A function that convert WS into TCP. There's a required parameter's:

  • targetString A Websocket Server target to convert to
  • forwardToPortNumber/String Forward to port?
  • forwardToHostnameString Forward to hostname?

Example

const { ws } = require('websockify.js');

ws('ws://localhost:8080', 9090, 'localhost');
// Now forwarding ws://localhost:8080 to tcp://localhost:9090

Community

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago

0.0.0

3 years ago