Sign inSign up

zhangsean/nps

By zhangsean

Updated 2 days ago

Containerized nps and npc based on alpine.

Image
1

10K+

zhangsean/nps repository overview

zhangsean/nps

Containerized nps and npc based on alpine.

Docker image for ehang-io/nps.

Docker Pulls Docker Image Size Docker Image Version GitHub Release

Tags

  • latest
  • v0.26.10

Environment variables

NameTypeDefaultDescription
NPS_MODEserver / client / allclientContainer running model
NPS_BRIDGE_TYPEtpc / udptcpBridge type for client connect to
NPS_BRIDGE_PORTPort8024Bridge bind port for client connect to
NPS_PUBLIC_VKEYString123Public key for client authorize, empty to disable
NPS_HTTP_PROXY_PORTPort80Http proxy bind port
NPS_HTTPS_PROXY_PORTPort443Https proxy bind port
NPS_WEB_USERNAMEStringadminWeb console user name
NPS_WEB_PASSWORDString123Web console password
NPS_WEB_PORTPort8080Web console bind port
NPS_HTTP_CACHEBoolfalseEnable http static file cache
NPC_SERVER_ADDRServerAddr:BridgePort127.0.0.1:8024ServerAddr And bridge port for client
NPC_CONN_TYPEtpc / udptcpBridge type for connect to server
NPC_VKEYString123vkey for current client

Usage

Server

Start a nps server with admin port 8080, connection port 8024 and reverse proxy port 80 and 443, expose 8024 and 80 ports in your internet firewall or load balancer which resole nps.example.com to.

docker run -itd --name nps --net host --privileged -e NPS_MODE=server -e NPS_PUBLIC_VKEY=npS2022 -e NPS_WEB_PASSWORD=admin321 zhangsean/nps

Start a nps server with your customized config file.

# Copy origin config file
docker run -it --rm -v $PWD:/tmp zhangsean/nps cp -a conf /tmp/
# Modify nps.conf as your need
vi conf/nps.conf
# Run nps server with your own conf
docker run -itd --name nps --net host --privileged -v $PWD/conf:/nps/conf -e NPS_MODE=server zhangsean/nps nps
Client

WARING: Any nps client which connected with public vkey will lose all service after reconnecting.

Open nps server web console with http://ip:8080, add a client then got it's special vkey 6exekiq8qkauw37t.

Start a nps client, connect to server nps.example.com.

docker run -itd --name npc -e NPC_SERVER_ADDR=nps.example.com:8024 -e NPC_VKEY=6exekiq8qkauw37t zhangsean/nps

Or start a nps client with args.

docker run -itd --name npc zhangsean/nps npc -server=nps.example.com:8024 -vkey=6exekiq8qkauw37t -type=tcp

Or start a nps client with your customized config file.

# Copy origin config file
docker run -it --rm -v $PWD:/tmp zhangsean/nps cp conf/npc.conf /tmp/
# Modify nps.conf as your need
vi npc.conf
# Run nps server with your own conf
docker run -itd --name npc -v $PWD/npc.conf:/nps/conf/npc.conf zhangsean/nps npc
Add service

Open the nps server web console with http://ip:8080, add some host forward or TCP forward service as your need.

All in one

You can start nps server and client in one container for temp local forward.

docker run -itd --name nps --net host --privileged -e NPS_MODE=all -e NPS_WEB_PASSWORD=admin321 zhangsean/nps

WARING: Any nps client which connected with public vkey will lose all service after reconnecting.

More

Please visit ehang-io/nps for more.

Tag summary

Content type

Image

Digest

sha256:9ecdb13f4

Size

10 MB

Last updated

2 days ago

docker pull zhangsean/nps