Free FrpService

初衷

手里面有一个树莓派3B,让他作为一个网络服务器提供服务下载服务,即便这玩意儿的网口和SD卡速度有点着急,但是也会比GitHub速度快,笔者一直深入机器视觉领域,所以OpenCV是家常便饭。但是编译OpenCV需要大量的文件却存放在GitHub,国内速度堪忧,所以打算用树莓派打造一款下载服务器,把常用文件放在树莓派上,让他工作起来,拒绝闲置。

官网

官网:https://github.com/fatedier/frp

动手搭建

目前有很多内网穿透技术,比如花生壳、DDNS映射、Ngrok、FRP、NSP等不计其数,由于笔者初衷是建立一个镜像站(https://mirrors.lucoder.com)。选择Frp有两个原因:

  1. 服务器带宽有限,Frp负责初次建立连接,不走服务器流量
  2. frp配置简单,可以当做nginx类似使用。

本站服务

写在前面:服务器部署在阿里云,没有备案域名的基本不用继续往下看了,因为没有备案域名阿里会拦截!
本站免费的frp服务,请注意保留端口为:7000、80、443、24、3389

服务器          :frp.lucoder.com
端口            :7000
Token           :frp.lucoder.com
http/https      : 80/443
远程桌面        :3389
ssh             : 24

使用方法

更多使用参考:参考文档

web服务

下面介绍如何使用frp访问家里电脑,注意端口请勿选择保留端口。

[common]
server_addr = frp.lucoder.com   # frp服务器
server_port = 7000              # frp 服务器端口

[web]
type = http                         # 使用的协议
local_port = 80                     # 绑定端口号
custom_domains = www.yourdomain.com # 绑定你的域名

然后,使用下面命令启动服务。

# 启动frp客户端
./.frpc -c frpc.ini

下面是使用https服务的配置:

[common]
server_addr = frp.lucoder.com   # frp服务器
server_port = 7000              # frp 服务器端口

[test_htts2http]                # 服务器标志符号
type = https
custom_domains = test.yourdomain.com

plugin = https2http
plugin_local_addr = 127.0.0.1:80

# HTTPS 证书相关的配置
plugin_crt_path = ./server.crt
plugin_key_path = ./server.key
plugin_host_header_rewrite = 127.0.0.1
plugin_header_X-From-Where = frp
  1. 这个是方法是我们建议的方法。当然,你也可以使用nginx反向代理方式,但是nginx不要使用443 和 80 端口,因为443和80务必留给frp使用!
  2. 标志符号可能会重复导致无法启动,所以我们建议使用和域名相关的标志符,比如:[web_your_domain_com]类似方式

ssh服务

下面介绍如何使用frp访问家里电脑,注意端口请勿选择保留端口。

[common]
server_addr = frp.lucoder.com   # frp服务器
server_port = 7000              # frp 服务器端口

[ssh]
type = tcp                      # 使用协议
local_ip = 127.0.0.1            # 家里的IP地址
local_port = 22                 # 家里ssh 端口号
remote_port = $portOfYours      # 你设置的端口号

其中,$portOfYours 是你设置的端口号,注意可能会失败,换一个端口号。使用方法如下:

# 启动frp客户端
./.frpc -c frpc.ini
# 输入你的ssh
ssh frp.lucoder.com -p $portOfYours

本站服务仅为调试使用,请勿长时间占用相关端口,每一个月15号和30号都会自动重启服务。

远程桌面服务【未经实验】

下面介绍如何使用frp访问家里电脑,注意端口请勿选择保留端口。

[common]
server_addr = frp.lucoder.com   # frp服务器
server_port = 7000              # frp 服务器端口

[ssh]
type = tcp                      # 使用协议
local_ip = 127.0.0.1            # 家里的IP地址
local_port = 3389                 # 家里电脑端口号
remote_port = 3389      # 你设置的端口号

其中,$portOfYours 是你设置的端口号,注意可能会失败,换一个端口号。使用方法如下:

# 启动frp客户端
./.frpc -c frpc.ini

然后启动远程桌面连接,地址是frp.lucoder.com。

原文地址:https://www.cnblogs.com/muxuan/p/12248890.html