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

sockz

v4.1.2

Published

Fun with sockets

Downloads

2

Readme

ts-sockz

TypeScript - Fun with sockets

Contents

Simple

# Start a local control server
npx sockz
# Start a local control agent
npx sockz agent
# Connect to control panel (netcat)
netcat localhost 2222
# Other TCP connection (telnet)
telnet localhost 2222

Visit the web client console:

Options

npx sockz <role> <host> <agentPort> <clientPort> <webPort> <prompt>

Allowed values:

  • role: server | agent
  • host: any<hostname | ipaddress>
  • agentPort: number
  • clientPort: number
  • webPort: number
  • prompt: string

Defaults

  • role: server
  • host: 127.0.0.1
  • agentPort: 1111
  • clientPort: 2222
  • webPort: 4040
  • prompt: "sockz> "

Advanced

To be able to connect remotely, use host 0.0.0.0

# Start remote control server
npx sockz server 0.0.0.0

To customize agent & client ports:

# Start control server with custom ports
npx sockz server 0.0.0.0 7331 1337
# Connect agent
npx sockz agent <host> 7331
# Connect session
netcat <host> 1337

To customize the session prompt:

# Start a server and use poop for client prompt
npx sockz server 0.0.0.0 1111 2222 4040 "💩 "

# Connect an authorized client
ncat --ssl --ssl-cert certs/client_cert.pem --ssl-key certs/client_key.pem localhost 2222
# Authorized client connection output
Authorized: Client
[id] SockzClient is ready
sockz> help
HELP: Commands: reg, whoami, exit, ping, info, help, ls, use
sockz>

# Connect an unauthorized client (use agent key)
ncat --ssl --ssl-cert certs/agent_cert.pem --ssl-key certs/agent_key.pem localhost 2222
# Unuthorized client connection output
Unauthorized: Agent (DEPTH_ZERO_SELF_SIGNED_CERT)

Install globally to run without npx

npm install --global sockz
# Or shortcut (same as above)
npm i -g sockz
# Start a server
sockz server
# Start an agent
sockz agent

Supports all the same options

Also available from docker:

https://github.com/cmr1/docker-sockz

docker run cmr1/sockz

Environment

Additional configuration options available as env vars:

  • All cert/key paths are resolved from certs/ directory
# Server environment variables
SERVER_HOST_NAME = 'localhost'
SERVER_CERT_NAME = 'server_cert.pem'
SERVER_KEY_NAME = 'server_key.pem'
# Comma separated list of ca cert names (required for auth)
SERVER_CA_NAME = 'server_cert.pem'

# Agent environment variables
AGENT_CERT_NAME = 'agent_cert.pem'
AGENT_KEY_NAME = 'agent_key.pem'
# Comma separated list of ca cert names (optional)
AGENT_CA_LIST = ''

WebClient

Visit https://localhost:4040/ in your browser

Self-signed cert, will have a warning