feat:添加rathole到列表
This commit is contained in:
13
apps/rathole/0.5.0/data/client.toml
Normal file
13
apps/rathole/0.5.0/data/client.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
[client]
|
||||
remote_addr = "127.0.0.1:7333"
|
||||
default_token = "puKAproP46cofREn3sTa"
|
||||
|
||||
[client.transport]
|
||||
type = "tls"
|
||||
[client.transport.tls]
|
||||
trusted_root = "tls/rootCA.crt"
|
||||
hostname = "localhost"
|
||||
|
||||
[client.services.my_nas_ssh]
|
||||
token = "use_a_secret_that_only_you_know" # 必须与服务器相同以通过验证
|
||||
local_addr = "127.0.0.1:22" # 需要被转发的服务的地址
|
||||
70
apps/rathole/0.5.0/data/full_example.toml
Normal file
70
apps/rathole/0.5.0/data/full_example.toml
Normal file
@@ -0,0 +1,70 @@
|
||||
[client]
|
||||
remote_addr = "example.com:2333" # Necessary. The address of the server
|
||||
default_token = "default_token_if_not_specify" # Optional. The default token of services, if they don't define their own ones
|
||||
heartbeat_timeout = 40 # Optional. Set to 0 to disable the application-layer heartbeat test. The value must be greater than `server.heartbeat_interval`. Default: 40 seconds
|
||||
retry_interval = 1 # Optional. The interval between retry to connect to the server. Default: 1 second
|
||||
|
||||
[client.transport] # The whole block is optional. Specify which transport to use
|
||||
type = "tcp" # Optional. Possible values: ["tcp", "tls", "noise"]. Default: "tcp"
|
||||
|
||||
[client.transport.tcp] # Optional. Also affects `noise` and `tls`
|
||||
proxy = "socks5://user:passwd@127.0.0.1:1080" # Optional. The proxy used to connect to the server. `http` and `socks5` is supported.
|
||||
nodelay = true # Optional. Override the `client.transport.nodelay` per service
|
||||
keepalive_secs = 20 # Optional. Specify `tcp_keepalive_time` in `tcp(7)`, if applicable. Default: 20 seconds
|
||||
keepalive_interval = 8 # Optional. Specify `tcp_keepalive_intvl` in `tcp(7)`, if applicable. Default: 8 seconds
|
||||
|
||||
[client.transport.tls] # Necessary if `type` is "tls"
|
||||
trusted_root = "ca.pem" # Necessary. The certificate of CA that signed the server's certificate
|
||||
hostname = "example.com" # Optional. The hostname that the client uses to validate the certificate. If not set, fallback to `client.remote_addr`
|
||||
|
||||
[client.transport.noise] # Noise protocol. See `docs/transport.md` for further explanation
|
||||
pattern = "Noise_NK_25519_ChaChaPoly_BLAKE2s" # Optional. Default value as shown
|
||||
local_private_key = "key_encoded_in_base64" # Optional
|
||||
remote_public_key = "key_encoded_in_base64" # Optional
|
||||
|
||||
[client.transport.websocket] # Necessary if `type` is "websocket"
|
||||
tls = true # If `true` then it will use settings in `client.transport.tls`
|
||||
|
||||
[client.services.service1] # A service that needs forwarding. The name `service1` can change arbitrarily, as long as identical to the name in the server's configuration
|
||||
type = "tcp" # Optional. The protocol that needs forwarding. Possible values: ["tcp", "udp"]. Default: "tcp"
|
||||
token = "whatever" # Necessary if `client.default_token` not set
|
||||
local_addr = "127.0.0.1:1081" # Necessary. The address of the service that needs to be forwarded
|
||||
nodelay = true # Optional. Determine whether to enable TCP_NODELAY for data transmission, if applicable, to improve the latency but decrease the bandwidth. Default: true
|
||||
retry_interval = 1 # Optional. The interval between retry to connect to the server. Default: inherits the global config
|
||||
|
||||
[client.services.service2] # Multiple services can be defined
|
||||
local_addr = "127.0.0.1:1082"
|
||||
|
||||
[server]
|
||||
bind_addr = "0.0.0.0:2333" # Necessary. The address that the server listens for clients. Generally only the port needs to be change.
|
||||
default_token = "default_token_if_not_specify" # Optional
|
||||
heartbeat_interval = 30 # Optional. The interval between two application-layer heartbeat. Set to 0 to disable sending heartbeat. Default: 30 seconds
|
||||
|
||||
[server.transport] # Same as `[client.transport]`
|
||||
type = "tcp"
|
||||
|
||||
[server.transport.tcp] # Same as the client
|
||||
nodelay = true
|
||||
keepalive_secs = 20
|
||||
keepalive_interval = 8
|
||||
|
||||
[server.transport.tls] # Necessary if `type` is "tls"
|
||||
pkcs12 = "identify.pfx" # Necessary. pkcs12 file of server's certificate and private key
|
||||
pkcs12_password = "password" # Necessary. Password of the pkcs12 file
|
||||
|
||||
[server.transport.noise] # Same as `[client.transport.noise]`
|
||||
pattern = "Noise_NK_25519_ChaChaPoly_BLAKE2s"
|
||||
local_private_key = "key_encoded_in_base64"
|
||||
remote_public_key = "key_encoded_in_base64"
|
||||
|
||||
[server.transport.websocket] # Necessary if `type` is "websocket"
|
||||
tls = true # If `true` then it will use settings in `server.transport.tls`
|
||||
|
||||
[server.services.service1] # The service name must be identical to the client side
|
||||
type = "tcp" # Optional. Same as the client `[client.services.X.type]
|
||||
token = "whatever" # Necessary if `server.default_token` not set
|
||||
bind_addr = "0.0.0.0:8081" # Necessary. The address of the service is exposed at. Generally only the port needs to be change.
|
||||
nodelay = true # Optional. Same as the client
|
||||
|
||||
[server.services.service2]
|
||||
bind_addr = "0.0.0.1:8082"
|
||||
13
apps/rathole/0.5.0/data/server.toml
Normal file
13
apps/rathole/0.5.0/data/server.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
[server]
|
||||
bind_addr = "0.0.0.0:7333"
|
||||
default_token = "puKAproP46cofREn3sTa"
|
||||
|
||||
[server.transport]
|
||||
type = "tls"
|
||||
[server.transport.tls]
|
||||
pkcs12 = "tls/identity.pfx"
|
||||
pkcs12_password = "1234"
|
||||
|
||||
[server.services.my_nas_ssh]
|
||||
token = "use_a_secret_that_only_you_know" # 用于验证的 token
|
||||
bind_addr = "0.0.0.0:5202" # `5202` 配置了将 `my_nas_ssh` 暴露给互联网的端口
|
||||
63
apps/rathole/0.5.0/data/tls/create_self_signed_cert.sh
Normal file
63
apps/rathole/0.5.0/data/tls/create_self_signed_cert.sh
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/bin/sh
|
||||
|
||||
# create CA
|
||||
openssl req -x509 \
|
||||
-sha256 -days 5000 \
|
||||
-nodes \
|
||||
-newkey rsa:2048 \
|
||||
-subj "/CN=MyOwnCA/C=US/L=San Fransisco" \
|
||||
-keyout rootCA.key -out rootCA.crt
|
||||
|
||||
# create server private key
|
||||
openssl genrsa -out server.key 2048
|
||||
|
||||
# create certificate signing request (CSR)
|
||||
cat > csr.conf <<EOF
|
||||
[ req ]
|
||||
default_bits = 2048
|
||||
prompt = no
|
||||
default_md = sha256
|
||||
req_extensions = req_ext
|
||||
distinguished_name = dn
|
||||
|
||||
[ dn ]
|
||||
C = US
|
||||
ST = California
|
||||
L = San Fransisco
|
||||
O = Someone
|
||||
OU = Someone
|
||||
CN = localhost
|
||||
|
||||
[ req_ext ]
|
||||
subjectAltName = @alt_names
|
||||
|
||||
[ alt_names ]
|
||||
DNS.1 = localhost
|
||||
EOF
|
||||
|
||||
openssl req -new -key server.key -out server.csr -config csr.conf
|
||||
|
||||
# create server cert
|
||||
cat > cert.conf <<EOF
|
||||
authorityKeyIdentifier=keyid,issuer
|
||||
basicConstraints=CA:FALSE
|
||||
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
|
||||
subjectAltName = @alt_names
|
||||
|
||||
[alt_names]
|
||||
DNS.1 = localhost
|
||||
EOF
|
||||
|
||||
openssl x509 -req \
|
||||
-in server.csr \
|
||||
-CA rootCA.crt -CAkey rootCA.key \
|
||||
-out server.crt \
|
||||
-days 36500 \
|
||||
-sha256 -extfile cert.conf
|
||||
|
||||
# create pkcs12
|
||||
openssl pkcs12 -export -out identity.pfx -inkey server.key -in server.crt -certfile rootCA.crt \
|
||||
-passout pass:1234 -keypbe PBE-SHA1-3DES -certpbe PBE-SHA1-3DES
|
||||
|
||||
# clean up
|
||||
rm server.csr csr.conf cert.conf
|
||||
BIN
apps/rathole/0.5.0/data/tls/identity.pfx
Normal file
BIN
apps/rathole/0.5.0/data/tls/identity.pfx
Normal file
Binary file not shown.
20
apps/rathole/0.5.0/data/tls/rootCA.crt
Normal file
20
apps/rathole/0.5.0/data/tls/rootCA.crt
Normal file
@@ -0,0 +1,20 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDTzCCAjegAwIBAgIUHPYndZflmbDV/30C+BHQSiNvUTQwDQYJKoZIhvcNAQEL
|
||||
BQAwNzEQMA4GA1UEAwwHTXlPd25DQTELMAkG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