npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wstcp-server

v1.0.1

Published

WebSocket TCP forwarding command-line server

Downloads

3

Readme

wstcp-server

WebSocket TCP forwarding command-line server.

wstcp is a client and server implementation of TCP forwarding over WebSocket. wstcp supports local and remote port forwarding, similar to OpenSSH.

Also see wstcp-client.

Diagram

Install

npm install wstcp-server

wstcp-server program will be installed in the bin directory.

Windows

Install as a Windows service:

npm install -g node-windows
npm run winservice_install

Uninstall

Windows

Uninstall the Windows service:

npm run winservice_uninstall

Usage

Run from console:

wstcp-server config.json

where config.json is a config file (see below).

Example

{
  "port": 10000,
  "log": "wstcp-server.log",
  "clients": {
    "client-1": {
      "key": "1234",
      "port": 10001,
      "remote": "true"
    },
    "client-2": {
      "key": "1234",
      "port": 10002,
      "remote": "true"
    }
  }
}

will start listening on port 10000 for WebSocket connections from clients, authenticated as client-1 or client-2 with key 1234. Incoming TCP connections on port 10001 will be forwarded to client-1, and incoming TCP connections on port 10002 will be forwarded to client-2.

Configuration

  • port: WebSocket port to listen on.
  • hostname: WebSocket hostname to listen on (default: ::).
  • log: Log file path (default: none). Relative paths are resolved relative to the config file.
  • client: List of clients.
    • key: Client name.
    • value:
      • key: Client authentication key.
      • port: TCP forwarding port.
      • remote: Remote TCP forwarding (default: false).

Remote forwarding (remote: true) means wstcp-client listens for incoming TCP connections and forwards them to wstcp-server. Local forwarding (remote: false) means incoming TCP connections are forwarded from wstcp-server to wstcp-client.

SSL

wstcp-server does not support SSL (wss), but one can use nginx as a HTTPS proxy. For example, this nginx configuration will pass wss:// requests to a local wstcp-server instance at ws://localhost:10000.

location / {
	proxy_pass http://localhost:10000;
	proxy_http_version 1.1;
	proxy_set_header Upgrade $http_upgrade;
	proxy_set_header Connection "upgrade";
}

Changelog

1.0.1 (2024-03-31)

  • Require latest version of wstcp.

1.0.0 (2021-07-10)

  • Initial release.

License

MIT