官方文档
需要有公网服务器

下载 Frp 到服务器

下载

frp_0.29.1_linux_amd64.tar.gz

解压

  1. $ tar zxvf frp_0.29.1_linux_amd64.tar.gz

上传

  1. $ scp frps frps.ini root@192.168.0.124:/root/frps

配置

frpc

  1. [common]
  2. server_addr = 39.105.141.168
  3. server_port = 7000
  4. # for authentication
  5. # token = 12345678
  6. [dev1]
  7. type = tcp
  8. local_ip = 127.0.0.1
  9. local_port = 22
  10. remote_port = 6000
  11. [web]
  12. type = https
  13. local_port = 443
  14. custom_domains = abser.top

fprs

  1. # [common] is integral section
  2. [common]
  3. # A literal address or host name for IPv6 must be enclosed
  4. # in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
  5. bind_addr = 0.0.0.0
  6. bind_port = 7000
  7. # udp port to help make udp hole to penetrate nat
  8. bind_udp_port = 7001
  9. # udp port used for kcp protocol, it can be same with 'bind_port'
  10. # if not set, kcp is disabled in frps
  11. kcp_bind_port = 7000
  12. # if you want to support virtual host, you must set the http port for listening (optional)
  13. # Note: http port and https port can be same with bind_port
  14. vhost_http_port = 8000
  15. vhost_https_port = 4430
  16. # set dashboard_addr and dashboard_port to view dashboard of frps
  17. # dashboard_addr's default value is same with bind_addr
  18. # dashboard is available only if dashboard_port is set
  19. dashboard_addr = 0.0.0.0
  20. dashboard_port = 7500
  21. # dashboard user and passwd for basic auth protect, if not set, both default value is admin
  22. dashboard_user = admin
  23. dashboard_pwd = admin
  24. # dashboard assets directory(only for debug mode)
  25. # assets_dir = ./static
  26. # console or real logFile path like ./frps.log
  27. log_file = ./frps.log
  28. # trace, debug, info, warn, error
  29. log_level = info
  30. log_max_days = 3
  31. # disable log colors when log_file is console, default is false
  32. disable_log_color = false
  33. # max ports can be used for each client, default value is 0 means no limit
  34. max_ports_per_client = 0
  35. # if tcp stream multiplexing is used, default is true
  36. tcp_mux = true

防火墙

阿里云

image.png

宝塔

或者关闭防火墙也行
image.png

启动与停止

centos 环境

运行

  1. $ nohup ./frps -c frps.ini >/dev/null 2>&1 &

或者客户端:

  1. $ nohup ./frpc -c ./frpc.ini >/dev/null 2>&1 &

停止

找到这个进程

  1. $ ps -aux|grep frp| grep -v grep
  2. root 3600 0.1 0.1 110188 9484 pts/0 Sl 15:04 0:00 ./frpc -c ./frpc.ini

kill

  1. $ kill -9 3600

运行

http://39.105.141.168:7500/static/#/proxies/tcp
image.png