secret-tunnel

module
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2022 License: Apache-2.0

README

Secret-Tunnel

Golang Docker Release License

Usage

Environment
Name Type Comment
ST_DEBUG bool (global) show verbose information
ST_DB_DSN string (server) sqlite database file location
Server
Usage:
  server [flags]

Flags:
      --addr string    server address (default "0.0.0.0:9797")
      --api string     api address (default "127.0.0.1:9799")
  -h, --help           help for server
      --token string   api token
  -v, --version        version for server
Client
Usage:
  client [flags]
  client [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  service     Run as a service

Flags:
      --addr string    server address (default "127.0.0.1:9797")
      --dns string     dns server (default "8.8.8.8")
  -h, --help           help for client
      --key string     auth key
      --tasks string   tasks json string (default "[]")
  -v, --version        version for client

Use "client [command] --help" for more information about a command.
Usage:
  client service [flags]
  client service [command]

Available Commands:
  install     Install the service
  reinstall   Reinstall the service
  restart     Restart the service
  start       Start the service
  status      Get the service status
  stop        Stop the service
  uninstall   Uninstall the service

Flags:
  -h, --help   help for service
      --user   run as current user, not root

Global Flags:
      --addr string    server address (default "127.0.0.1:9797")
      --dns string     dns server (default "8.8.8.8")
      --key string     auth key
      --tasks string   tasks json string (default "[]")

Use "client service [command] --help" for more information about a command.

Docker

Server Docker Hub

Version Size Pull

Client Docker Hub

Version Size Pull

Example

Server
sts
curl \
--location \
--request POST 'http://127.0.0.1:9799/client' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "发送端"
}'
curl \
--location \
--request POST 'http://127.0.0.1:9799/client' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "接收端"
}'
curl \
--location \
--request POST 'http://127.0.0.1:9799/task' \
--header 'Content-Type: application/json' \
--data-raw '{
    "client_id": 1,
    "name": "ssh",
    "addr": "127.0.0.1:22"
}'
Client
  • 发送端
stc --addr 127.0.0.1:9797 --key fb9a318168714565993f75b97e6af907
  • 发送端(服务)
stc service --user install --addr 127.0.0.1:9797 --key fb9a318168714565993f75b97e6af907
stc service --user start
stc service --user stop
stc service --user uninstall
  • 接收端
stc --addr 127.0.0.1:9797 --key ef335f0c7a9643d19d06591672576f46 --tasks '[{"address":":2222","secret":"aeb46c771cab4087a6c3fba4ef306472"}]'
Data Transfer
ssh:22 <-> stc(发送端) <-> sts(9797) <-> stc(接收端) <-> ssh:2222

License

Apache License 2.0

Directories

Path Synopsis
cmd
internal
hx
osx

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL