Skip to content

部署转发服务

rev1si0n edited this page Dec 10, 2023 · 2 revisions

注意此类端口转发程序只建议在 Linux 类系统上使用,开始前请先放通防火墙 6009/tcp,请按照自身需求修改配置。

保存如下文件到 ~/frps.ini

[common]
bind_addr               = 0.0.0.0
bind_port               = 6009

token                   = lamda
use_encryption          = true
tls_enable              = true
allow_ports             = 2000-5000
authentication_timeout  = 60

proxy_bind_addr         = 127.0.0.1
max_pool_count          = 15

执行如下脚本下载并启动 frps

export VERSION=0.52.0
export PLAT=linux_amd64

export DOWNLOADURL=https://github.com/fatedier/frp/releases/download/v${VERSION}/frp_${VERSION}_${PLAT}.tar.gz
wget ${DOWNLOADURL} -O - | tar -xz

cd frp_${VERSION}_${PLAT}/frps

./frps -c ~/frps.ini

编写保存如下配置到 /data/usr/properties.local

fwd.host=你的服务器IP
fwd.port=6009
fwd.rport=0
fwd.token=lamda
fwd.protocol=tcp
fwd.enable=true

重启设备并启动 lamda,现在 lamda 将会自动将自身端口转发到该服务器的 127.0.0.1 上。