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 🙏

© 2026 – Pkg Stats / Ryan Hefner

socksws

v2.0.0

Published

SOCKS5 in WebSockets ====================

Downloads

5

Readme

SOCKS5 in WebSockets

SOCKS5 is a dead simple little protocol that makes very thin TCP and UDP proxies. SOCKS is notable because it allows the client to decide where to proxy to.

This code implements SOCKS5 on top of WebSockets. If you point websockify at a SOCKS proxy, you will be able to proxy from your web browser to anywhere in the world.

Demo

Run a SOCKS server. The quickest is:

$ ssh -D 7777 localhost

Run websockify in front of that SOCKS server

$ websockify 8081 localhost:7777

Run the socks5.js client:

$ node test.socks5.js google.com:80

You probably need to npm install ws and npm install ayepromise first.

This gets more interesting if instead of sshing in the first step to localhost, you ssh somewhere you have a shell account. Then the demo script will appear to google (or whoever you hit) to be coming from the system you have a shell account on.

The same library also works in your browser!

API

The API is based heavily on Promises/A+, which allows writing async code in a nearly-synchronous way.

var prx = new SOCKS5("ws://my-socks-proxy:1080", "bbs-site.com:666")
prx.onopen = function() {
  prx.send("Hello!")
  prx.read(20).then(function(data) {
    //...
  }).then(function() { return prx.read(21) }) //It is important to wrap future reads in
                                              // thunks so that reads are ordered properly.
  .then(function(data) {                      //When the promise of prx.read() resolves,
                                              // its value ends up in 'data'.
    //...
  })
}

SOCKS software

Servers:

  • ssh has a -D switch which makes your local machine into a SOCKS proxy, tunneling through to the other end of your ssh session. By default it only allows connections from localhost which is reasonably secure for short term use like getting around a school firewall.
  • dante is a little more fully featured SOCKS system with whitelisting and bandwidth throttling.
  • tor relies crucially on SOCKS to move your traffic--including your DNS traffic--off your computer and into the TOR mixnet.

Clients:

  • Most browsers support SOCKS5. Look under Network Settings in Firefox.
  • tsocks which was forked to torsocks which wraps any Unix program through a SOCKS proxy.