Provide Simple File Access Service
By configuring the
static_file client plugin, you can expose local files on the public network for others to access.By using the static_file plugin, you can easily provide an HTTP-based file access service that allows others to access your specified files.
Steps
-
Configure frps.toml
Add the following content to the frps.toml file:
bindPort = 7000 -
Configure frpc.toml
Add the following content to the frpc.toml file, ensuring appropriate file paths, username, 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" # Local file directory to provide external access localPath = "/tmp/file" # Prefix in URL that will be removed, remaining content is the file path to access stripPrefix = "static" httpUser = "abc" httpPassword = "abc"Please modify
localPath,stripPrefix,httpUser, andhttpPasswordaccording to your actual situation. -
Start frps and frpc
-
Access Files via Browser
Use a browser to visit
http://x.x.x.x:6000/static/to view files located in the/tmp/filedirectory. The system will require you to enter the username and password you set.