liudf0716 / xfrpc

The xfrpc project is a lightweight implementation of the FRP client written in C language for OpenWRT and IoT systems. It is designed to provide an efficient solution for resource-constrained devices such as OpenWRT routers and IoT devices, which often have limited ROM and RAM space.
GNU General Public License v3.0
719 stars 90 forks source link

SCTP mode supported #25

Open liudf0716 opened 1 year ago

liudf0716 commented 1 year ago

xfrpc currently does not support STCP, and we are in need of assistance to implement it. As stated in the frp documentation, 'STCP' is described as:

Expose your service privately Some services will be at risk if exposed directly to the public network. With STCP (secret TCP) mode, a preshared key is needed to access the service from another client.

Configure frps same as above.

Start frpc on machine B with the following config. This example is for exposing the SSH service (port 22), and note the sk field for the preshared key, and that the remote_port field is removed here:

frpc.ini

[common] server_addr = x.x.x.x server_port = 7000

[secret_ssh] type = stcp sk = abcdefg local_ip = 127.0.0.1 local_port = 22 Start another frpc (typically on another machine C) with the following config to access the SSH service with a security key (sk field):

frpc.ini

[common] server_addr = x.x.x.x server_port = 7000

[secret_ssh_visitor] type = stcp role = visitor server_name = secret_ssh sk = abcdefg bind_addr = 127.0.0.1 bind_port = 6000 On machine C, connect to SSH on machine B, using this command: ssh -oPort=6000 127.0.0.1