🚀 DAY 4 OF LAUNCH WEEK: Introducing GitHub Actions Scanning Support.Learn more →
Socket
Book a DemoInstallSign in
Socket

@xutl/forward

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xutl/forward

Port Forwarding

latest
npmnpm
Version
0.0.3
Version published
Maintainers
2
Created
Source

@xutl/forward

This is a simple port forwarding tool meant to be used with local VMs.

Usage (CLI)

npx @xutl/forward --host=<address> <source-port>:<target-port>

In this use case --host is optional and is meant to be a local address to listen on. source-port is the local port to listen on and target-port is the port on localhost to forward to.

If --host is not a local address, then this will instelad listen on localhost:<source-port> and forward to <host>:<target-port>.

If --host is missing it will listen on all local addresses except localhost.

<source-port>:<target-port> can be simplified to just <port> for the case where they are identical.

Usage (Programatic)


import PortForward from '@xutl/forward';

// type EndPoint = { address: string, port: number };
const forward = new PortForward(listen: EndPoint, target: EndPoint);
forward.on('listening', ()=>{});
forward.on('connection', (client: EndPoint)=>{});
forward.on('disconnection', (client: EndPoint)=>{});
forward.on('close', ()=>{});
forward.on('error', (error: Error)=>{});

Keywords

TCP

FAQs

Package last updated on 04 Jul 2025

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