通过 static_file 插件可以对外提供一个简单的基于 HTTP 的文件访问服务。类似于http的文件索引!

服务端frps.ini配置
[common]
bind_addr = 0.0.0.0
bind_port = 7000
privilege_token = 12345678

客户端frpc.ini配置
[common]
server_addr = 服务端IP
server_port = 7000
privilege_token = 12345678

[static_file]
type = tcp
local_ip = 127.0.0.1
remote_port = 6000
plugin = static_file
plugin_local_path = /tmp/file
plugin_strip_prefix = static
plugin_http_user = admin
plugin_http_passwd = admin

static_file 插件参数详解
plugin = static_file为开启插件static_file模式
plugin_local_path文件目录的绝对路径
plugin_strip_prefix访问网址后缀路径
通过浏览器访问 http://x.x.x.x:6000/static/
来查看位于 /tmp/file 目录下的文件,如不需要,可以不添加此参数。
plugin_http_user为http访问验证的用户名,可自定义,可添加此参数或不添加。
plugin_http_passwd为http访问验证的密码,可自定义,可添加此参数或不添加。

注意:客户端访问时需要加上端口号,每个客户端使用的端口号均不能相同

实际配置

frps服务端配置(linux系统)
[root@hn frps]# cat frps.ini
[common]
bind_port = 7000
vhost_http_port = 8080
#vhost_https_port = 8080
dashboard_port = 7500
# dashboard 用户名密码,默认都为 admin
dashboard_user = admin
dashboard_pwd = admin
privilege_token = 12345678
privilege_allow_ports = 2000-3000
max_pool_count = 10
subdomain_host = 1.2.com
log_file = ./frps.log
log_level = info
log_max_days = 3

windows作为frpc客户端使用 =>访问地址:http://x.x.x.x:2900/static
[common]
server_addr = x.x.x.x  #frps服务端IP
server_port = 7000
privilege_token = 12345678 #校验
pool_count = 2
log_file = ./frpc.log
log_level = info
log_max_days = 3

[static_file]
type = tcp
local_ip = 127.0.0.1
remote_port = 2900  #frps服务端端口放行
plugin = static_file
plugin_local_path = D:/Py/10  #本机目录,注意写法
plugin_strip_prefix = static
plugin_http_user = admin  #账号
plugin_http_passwd = admin #密码

linux作为frpc客户端使用  =>访问地址:http://x.x.x.x:2002/static
[common]
server_addr = x.x.x.x
server_port = 7000
privilege_token = 12345678
pool_port = 2
log_file = ./frpc.log
log_level = info
log_max_days = 3

[plugin_static_file]
type = tcp
remote_port = 2002
plugin = static_file
plugin_local_path = /tmp/file
plugin_strip_prefix = static
plugin_http_user = abc
plugin_http_passwd = abc

九、frp对外提供简单的文件访问服务的更多相关文章

  1. zookeeper集群,每个服务器上的数据是相同的,每一个服务器均可以对外提供读和写的服务,这点和redis是相同的,即对客户端来讲每个服务器都是平等的。

    zookeeper集群,每个服务器上的数据是相同的,每一个服务器均可以对外提供读和写的服务,这点和redis是相同的,即对客户端来讲每个服务器都是平等的.

  2. 基于FeignClient提供简单的用户查询服务

    前言: 由于系统升级,之前的员工数据库(mongo库)被弃用,改为用python维护的mysql库,其他系统访问通过http请求,表结构对外不可见,其他系统之前对员工mongo库的依赖要解除.每套系统 ...

  3. 开发FTP服务接口,对外提供接口服务

    注意:本文只适合小文本文件的上传下载,因为post请求是有大小限制的.默认大小是2m,虽然具体数值可以调节,但不适合做大文件的传输 最近公司有这么个需求:以后所有的项目开发中需要使用ftp服务器的地方 ...

  4. Frp内网穿透搭建,家庭主机对外提供接口,支持ssh访问

    Frp内网穿透搭建,家庭主机对外提供接口,支持ssh访问 1.使用场景: 需求1.家中服务器 ubuntu 主机,跑接口服务,需要对外暴漏, 需求2.同时需要在外网ssh远程 ​ 关键词: frp内网 ...

  5. 使用jsp/servlet简单实现文件上传与下载

    使用JSP/Servlet简单实现文件上传与下载    通过学习黑马jsp教学视频,我学会了使用jsp与servlet简单地实现web的文件的上传与下载,首先感谢黑马.好了,下面来简单了解如何通过使用 ...

  6. Android学习笔记(十九)——内容提供器

    //此系列博文是<第一行Android代码>的学习笔记,如有错漏,欢迎指正! 内容提供器(Content Provider)主要用于在不同的应用程序之间实现数据共享的功能,它提供了一套完整 ...

  7. 使用WCF对外提供接口

    本篇将通过WCF以webservices的方式对外提供接口.同时使用NUnit对webservices中的方法进行单元测试. 开发契约 contract Contract项目为类库项目,该项目下会包含 ...

  8. grpc-gateway:grpc对外提供http服务的解决方案

    我所在公司的项目是采用基于Restful的微服务架构,随着微服务之间的沟通越来越频繁,就希望可以做成用rpc来做内部的通讯,对外依然用Restful.于是就想到了google的grpc. 使用grpc ...

  9. atitit.网络文件访问协议.unc smb nfs ftp http的区别

    atitit.网络文件访问协议.unc smb nfs ftp http的区别 1. 网络文件访问协议1 2. NETBios协议  2 3. SMB(Server Message Block)2 3 ...

随机推荐

  1. centos7把编译安装的服务通过systemctl管理

    nginx编译安装的目录是/usr/local/nginx nginx配置文件是/usr/local/nginx/conf/nginx.conf systemctl管理的服务文件在/usr/lib/s ...

  2. Linux 内核管理

    Linux内核基础:Linux Kernel:  Linux内核的体积结构是单内核的,但充分借鉴了微内核设计体系的优点,为内核引入模块化机制,使得虽然是单内核,但工作在模块化的方式下,并且模块可以动态 ...

  3. [SharePoint][SharePoint Designer 入门经典]Chapter8 XSLT数据试图和表单

    本章概要: 1.不是利用XSLT web部件 2.使用XSLT web部件创建数据试图 3.使用XSLT表单web部件创建自定义表单 4.利用自定义动作执行列表表单

  4. esql开发总结

    1 定义或者声明方法 int method(char *arg1,char* arg2...);   实现方法 int method(char *arg1,char* arg2...)     EXE ...

  5. git在win7下安装的问题

    本帖最后由 ikscher 于 2015-07-30 20:24:16 编辑 从官网下载的最新版本号git-1.9.2-preview版本号,安装在还有一台win7下没有此错误,可是安装在当中一台出现 ...

  6. caffe—ssd安装教程

    环境: ubuntu16.04 cuda8.0 cudnn5.0 已安装过caffe1.0 tensorflow1.2 编辑过程中出现问题尽量到这里面搜一下:https://github.com/BV ...

  7. 0x12 队列

    感觉和栈那一讲一样简单啊.. poj2259 这个乱搞硬模拟吧...没更新last WA了N次...(叫你懒得写拍) #include<cstdio> #include<iostre ...

  8. SQL Server loop - how do I loop through a set of records

    SQL Server loop - how do I loop through a set of records By using T-SQL and cursors like this : DECL ...

  9. tp中使用事务

    是什么 事务是为了防止,多个操作,其中有失败,数据有部分被执行成功的时候使用的. 比如,银行,用户转账.张三钱扣了,结果李四钱还增加! 这个时候需要使用事务,确保张三钱扣了,李四的钱也增加,才真正的成 ...

  10. 33.Qt模型与视图

    #include "mainwindow.h" #include <QApplication> #include <QAbstractItemModel> ...