一、在有公网IP的服务器上下载frp
cd /opt/
wget https://github.com/fatedier/frp/releases/download/v0.16.0/frp_0.16.0_linux_amd64.tar.gz
二、安装frp
cd /opt/
tar zxvf frp_0.16.0_linux_amd64.tar.gz
cd frp_0.16.0_linux_amd64
修改 frps.ini 文件(frps_full.ini中是全配置的情况,可以参考配置),设置 http 访问端口为 8084:
# frps.ini
[common]
bind_port = 7000
vhost_http_port = 8084
vhost_https_port = 443
启动 frps
./frps -c ./frps.ini
三、在内网开发机器上操作
windiws下载:
https://github.com/fatedier/frp/releases/download/v0.16.0/frp_0.16.0_windows_amd64.zip
Linux下载:
wget https://github.com/fatedier/frp/releases/download/v0.16.0/frp_0.16.0_linux_amd64.tar.gz
下载完成后解压。
修改 frpc.ini 文件,假设 frps 所在的服务器的 IP 为 x.x.x.x,local_port 为本地机器上 web 服务对应的端口, 绑定自定义域名或者公网IP frpc.yourdomain.com
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[tcp]
type = tcp
local_ip = 127.0.0.1
local_port = 15440
remote_port = 15440
[httpweb]
type = http
local_port = 8084
custom_domains = frpc.yourdomain.com
[httpsweb]
type = https
local_port = 443
custom_domains = wx.yourdomain.com
启动 frpc
./frpc -c ./frpc.ini
解决微信公众号开发只能是80端口问题:
安装nginx,并域名反向代理如下:
# frpc.conf
server {
listen 80;
server_name frpc.yourdomain.com;
location / {
proxy_pass http://frpc.yourdomain.com:8084/;
}
}
测试验证:
在开发电脑启动端口号为8084的web服务,在浏览器中输入:
http://frpc.yourdomain.com
如果能够正常看到相应页面则表示成功,否则表示不成功。如果不成功则检查相应流程,我这里测试是成功的。
cd /opt/
wget https://github.com/fatedier/frp/releases/download/v0.16.0/frp_0.16.0_linux_amd64.tar.gz
二、安装frp
cd /opt/
tar zxvf frp_0.16.0_linux_amd64.tar.gz
cd frp_0.16.0_linux_amd64
修改 frps.ini 文件(frps_full.ini中是全配置的情况,可以参考配置),设置 http 访问端口为 8084:
# frps.ini
[common]
bind_port = 7000
vhost_http_port = 8084
vhost_https_port = 443
启动 frps
./frps -c ./frps.ini
三、在内网开发机器上操作
windiws下载:
https://github.com/fatedier/frp/releases/download/v0.16.0/frp_0.16.0_windows_amd64.zip
Linux下载:
wget https://github.com/fatedier/frp/releases/download/v0.16.0/frp_0.16.0_linux_amd64.tar.gz
下载完成后解压。
修改 frpc.ini 文件,假设 frps 所在的服务器的 IP 为 x.x.x.x,local_port 为本地机器上 web 服务对应的端口, 绑定自定义域名或者公网IP frpc.yourdomain.com
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[tcp]
type = tcp
local_ip = 127.0.0.1
local_port = 15440
remote_port = 15440
[httpweb]
type = http
local_port = 8084
custom_domains = frpc.yourdomain.com
[httpsweb]
type = https
local_port = 443
custom_domains = wx.yourdomain.com
启动 frpc
./frpc -c ./frpc.ini
解决微信公众号开发只能是80端口问题:
安装nginx,并域名反向代理如下:
# frpc.conf
server {
listen 80;
server_name frpc.yourdomain.com;
location / {
proxy_pass http://frpc.yourdomain.com:8084/;
}
}
测试验证:
在开发电脑启动端口号为8084的web服务,在浏览器中输入:
http://frpc.yourdomain.com
如果能够正常看到相应页面则表示成功,否则表示不成功。如果不成功则检查相应流程,我这里测试是成功的。