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

@2players/jet

v4.4.0

Published

An HTTP pre-proxy for SOCKS.

Downloads

8

Readme

The name "jet" is inspired by Jet Black from Cowboy Bepop.

Index

What does Jet do?

                                      ┌──────────────────────┐
                                      │SOCKS v4/v4a/v5 Proxy │
                                ┌────▶│  (ShadowSocks etc.)  │──────┐
                                │     └──────────────────────┘      │
                                │                                   ▼
     ┌──────────────────┐     ┌───┐                            ┌────────┐
     │ User Application │────▶│Jet│───────────────────────────▶│Internet│
     └──────────────────┘     └───┘                            └────────┘

Features

  • support SOCKS v4/v4a/v5
  • support DNS cache
  • route requests via GeoIP CN automatically
  • hot switching between auto / direct / tunnel mode

Requirements

  • Node.js >= 8.0.0

Installation

npm install -g @2players/jet

Setting Jet via environment variables

Format instruction:

VAR - DEFAULT VALUE

Change SOCKS Proxy setting via 3 environment variables:

  • JET_SOCKS_ADDR - 127.0.0.1
  • JET_SOCKS_PORT - 1080
  • JET_SOCKS_TYPE - 5

Change setting of listening:

  • JET_LISTEN_ADDR - 127.0.0.1
  • JET_LISTEN_PORT - 9527

Running Jet

# sync GeoIP info
shell> jet sync-geoip

# jet runs on 127.0.0.1:9527 by default
shell> jet run

# run jet on another port, like 9600
shell> JET_LISTEN_PORT=9600 jet run

# after a period of time, you maybe want to update GeoIP info,
# just sync it again
shell> jet sync-geoip

Configure All Your Application To Use Jet.

For GUI

I think you know how to set this. It's simple.

For CLI

Suppose that Jet is running at 127.0.0.1:9527.

CHANNEL="http://127.0.0.1:9527"
NO_CHANNEL="localhost,127.0.0.1"

PROXY_ENV="http_proxy ftp_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY ALL_PROXY"
NO_PROXY_ENV="no_proxy NO_PROXY"
for envar in $PROXY_ENV; do
    export $envar=$CHANNEL
done

for envar in $NO_PROXY_ENV; do
    export $envar=$NO_CHANNEL
done

unset CHANNEL
unset NO_CHANNEL
unset PROXY_ENV
unset NO_PROXY_ENV

Add above script to your shell init file, like ~/.bashrc. Then source it.

If you are using other shell, set above environment variables by yourself.

Test The Effects

Test Jet is Working Or Not

shell> curl --proxy localhost:9527 https://www.google.com/

If you get right content, then jet is working.

Test Your Shell Environment Is Set Properly Or Not

shell> curl https://www.google.com/

If you get right content, then jet is working. And your shell environment is set properly, too.

Advanced Features

Hot switching mode

By defaut, jet is running in auto mode (a mode that routes request according GeoIP). In addition to this mode, there are two other mode:

  • direct - request directly, globally
  • tunnel - request through SOCKS proxy globally

When you run jet in terminal, you'll get this:

[INFO] Reading GeoIP info.
[INFO] DNS: 127.0.0.1
[INFO] Listening on 127.0.0.1:9527.
> TUNNEL 127.0.0.1 -> https://live.github.com:443/
> TUNNEL 127.0.0.1 -> https://live.github.com:443/

In order to hot switch current mode, just type supported mode directly. Take direct mode as an example:

[INFO] Reading GeoIP info.
[INFO] DNS: 127.0.0.1
[INFO] Listening on 127.0.0.1:9527.
> TUNNEL 127.0.0.1 -> https://live.github.com:443/
> TUNNEL 127.0.0.1 -> https://live.github.com:443/
direct  <- the mode you type
[INFO] Switch to direct mode
> DIRECT 127.0.0.1 -> https://live.github.com:443/

Uninstallation

If you think jet is not suitable for you, remove it with following commands:

# remove npm package
shell> npm uninstall -g jet

# remove related directory
shell> rm -rf ~/.config/jet

Reference

Similar Tools