frp的作用

一句话牛皮,frp内网穿透的东西,简单的配置,马上就可以爱上介款程序。

开始配置

  1. 配置服务端

    何为服务端,就是拥有一个服务器(外网),输入命令uname -a看程序架构,这里只说明centos系统。然后去github下载软件包,一定要选择自己系统的机构。

    下载完解压,因为我们是服务端,所以指定连接frp的端口,和web的端口即可。注意!!!frps是服务端,frpc是客户端,就是内网,需要穿透的客户端。

    1
    2
    3
    [common]
    bind_port = 7000
    vhost_http_port = 8888

    bind_port:frp端口

    vhost_http_port:web端口,这个注意点,就是你访问web(外网)的端口

    执行启动命令:

    1
    ./frps -c ./frps.ini 

    可设置简单的脚本

    1
    nohup ./frps -c ./frps/ini &
  2. 配置客户端

    一样的操作,去GitHub下载程序。解压后,配置frpc.ini这个配置

    1
    2
    3
    4
    5
    6
    7
    8
    [common]
    server_addr = frp_ip
    server_port = 7000

    [web]
    type = http
    local_port = 7777
    custom_domains = web_ip

    frp_ip:填写服务端的ip

    server_port:服务端的frp端口

    local_port:这个注意,这个填写本地web的端口,就你你要客户端要穿透的端口

    custom_domains:这个更要注意,这个填写你要外网访问的ip或者网址。比如,你外网地址xxxx.xxxx.xxx,本地要映射的端口是7777。然后,你直接访问xxxx.xxxx.xxx:8888,可以直接访问到内网的7777端口的web,很简单。custom_domains可以填写ip,就是服务端的IP,或者服务端绑定的网址。

    执行启动命令:

    1
    ./frpc -c ./frpc.ini