New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@movable/socketproxy

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@movable/socketproxy

Expose a local webserver via a remote subdmoain, over websockets

Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
13
-80.88%
Maintainers
4
Weekly downloads
 
Created
Source

SocketProxy

Expose a local node http server via a remote URL.

Motivation: you run a local http-based node app that you want to expose to the world, and you also have the ability to run a public node app elsewhere.

SocketProxy comes in two parts:

  • The SocketProxy client connects to the SocketProxy server via websockets and receives a public subdomain URL.
  • The SocketProxy server listens on an http/https port, maps the request subdomain to a SocketProxy client, and then proxies the http/https request to the SocketProxy client over websockets.

Usage

The server works out of the box, the client will need to be customized for your app. Starting the server:

bin/server --port=8080

See bin/server --help for all options.

An example client can be found at bin/example-client.

const SocketProxy = require('socketproxy');

const app = express();
app.use(...)

const proxy = new SocketProxy({
  url: 'ws://socketproxy-server:8080',
  app: app
});

proxy.connect().then((p) => {
  console.log("Connected", p.uri);
});

Replace socketproxy-server above with the hostname of your SocketProxy server.

Alternatives

localtunnel is a popular alternative for some similar use cases. Notable differences are that it is actually a full TCP tunnel while the SocketProxy client connects directly to an express/connect handler, so doesn't generate any extra connections on the client machine. SocketProxy was developed because localtunnel isn't able to encrypt TCP traffic, and requires the use of all of the server's ports. For high-throughput uses, localtunnel is likely quite a bit faster since it will use many TCP connections rather than a single multiplexed-via-json websockets connection.

License

See LICENSE.txt

Keywords

proxy

FAQs

Package last updated on 19 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts