2023 The frp Authors 保留所有权利
中文|English
static_file
客户端插件,您可以将本地文件暴露在公网上,以供其他人访问。
通过使用
static_file
插件,您可以轻松地提供一个基于 HTTP
的文件访问服务,让其他人可以访问您指定的文件。
配置 frps.toml
在 frps.toml 文件中添加以下内容:
bindPort = 7000
配置 frpc.toml
在 frpc.toml 文件中添加以下内容,确保设置合适的文件路径、用户名和密码:
serverAddr = "x.x.x.x"
serverPort = 7000
[[proxies]]
name = "test_static_file"
type = "tcp"
remotePort = 6000
[proxies.plugin]
type = "static_file"
# 本地文件目录,对外提供访问
localPath = "/tmp/file"
# URL 中的前缀,将被去除,保留的内容即为要访问的文件路径
stripPrefix = "static"
httpUser = "abc"
httpPassword = "abc"
请根据实际情况修改
localPath
、stripPrefix
、httpUser
和 httpPassword
。
启动 frps 和 frpc
通过浏览器访问文件
使用浏览器访问
http://x.x.x.x:6000/static/
,以查看位于
/tmp/file
目录下的文件。系统会要求输入您设置的用户名和密码。
static_file
ClientPlug-in, you can expose local files on the public
network for others to access.
Through Use
static_file
Plug-in, you can easily provide a
method based on. HTTP's file access service allows others to
access the files you specify.
Configuration frps.toml
Add the following to the frps.toml file:
bindPort = 7000
Configuration frpc.toml
In frpc.toml. Add the following to the file to ensure that the appropriate file path, user name, and password are set:
serverAddr = "x.x.x.x"
serverPort = 7000
[[proxies]]
name = "test_static_file"
type = "tcp"
remotePort = 6000
[proxies.plugin]
type = "static_file"
# 本地文件目录,对外提供访问
localPath = "/tmp/file"
# URL 中的前缀,将被去除,保留的内容即为要访问的文件路径
stripPrefix = "static"
httpUser = "abc"
httpPassword = "abc"
Please modify it according to the actual situation
localPath
、stripPrefix
、httpUser
And httpPassword
。
Start frps and frpc
Access files through a browser
Use browser access
http://x.x.x.x:6000/static/
to view the
location
/tmp/file
Files in the directory. The system will require you to
enter the username and password you have set.