服务器端不用改什么
FRP提供了一个方法来实现文件的http访问服务。
frpc.ini最后加上一段
[test_static_file] type = tcp #端口不能和我的其他端口重复 remote_port = 6002 plugin = static_file # 要对外暴露的文件目录 plugin_local_path = /home/yuexiaoheng/Videos # 访问 url 中会被去除的前缀,保留的内容即为要访问的文件路径 plugin_strip_prefix = static plugin_http_user = abc plugin_http_passwd = abc |
访问地址http://test.java-er.com:6002/static
说明plugin_strip_prefix 如果改成files 那么访问地址就是http://test.java-er.com:6002/files
查看服务器发现再次多了一个tcp链接
对于一个程序员来说,机器上总会有个什么apache之类的,所以这个功能似乎没什么必要。不过这个的好处,就是快,简单配置一下就好了。我这台ubuntu就还没有安装apache