In Windows 10, intranet penetration via client (FRPC)

修改之后,授权成功
1. Background In development, there are often situations where public domain names need to be used, which can be divided into two situations: One is that if you want to show the results of your local development to others, you need to publish it on the public website; One is like WeChat development, which requires a public network address to complete the debugging. If you just use it temporarily but you have to buy a VPS and then deploy it on it, it will be very inconvenient. Using FRP to do intranet penetration is to solve these two problems. It can directly map the local to the public network, saving the trouble of deploying on the server. 2. Client configuration, client download address (use the latest version). https://github.com/fatedier/frp/releases . Select: FRP_0.42.0_Windows_AMD64.zip . as shown in Figure 1
客户端配置,客户端下载地址(使用最新版本)。https://github.com/fatedier/frp/releases 。选择:frp_0.42.0_windows_amd64.zip
Figure 1
3. After downloading, you need to trust this file. Killsoft will clear the files in it, and you need to add trust. Unzip to: C:\FRP_0.42.0_Windows_AMD64 . as shown in Figure 2
下载后,需要信任此文件,杀软会清除其中的文件,需要添加信任。解压至:C:\frp_0.42.0_windows_amd64
Figure 2
4. Modify frpc.ini, the top is the server configuration, and the following is your native configuration, the original configuration is as follows


[common]
server_addr = 127.0.0.1
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000



5. The modified example is as follows


[common]
server_addr = x.x.x.x
server_port = 5000
token = aaa

[chengdu-wangqiang-x-local]
type = http
local_ip = 127.0.0.1
local_port= 8001
custom_domains = chengdu-wangqiang-x-local.frp.x.top




6. Start frpc: frpc -c frpc.ini. If you are a Windows user, you need to execute the command in the cmd terminal. Prompt access is denied. Open the 360 antivirus software and restore the FRP related files in the 360 recovery area. Run again, prompt: Login server failed: Authorization failed. The value of token = aaa is incorrect and needs to be obtained from the server. as shown in Figure 3
启动frpc:frpc -c frpc.ini。如果是 Windows 用户,需要在 cmd 终端中执行命令。提示拒绝访问。打开 360 杀毒软件,在 360 恢复区中恢复 frp 的相关文件。再次运行,提示:登录服务器失败:授权失败。token = aaa 的值不正确,需要从服务端获取
Figure 3


C:\Windows\system32>cd ..

C:\Windows>cd ..

C:\>cd frp_0.42.0_windows_amd64

C:\frp_0.42.0_windows_amd64>.\frpc -c .\frpc.ini
拒绝访问。

C:\frp_0.42.0_windows_amd64>.\frpc -c .\frpc.ini
2022/05/11 11:42:31 [E] [service.go:340] authorization failed
2022/05/11 11:42:31 [W] [service.go:128] login to server failed: authorization failed
authorization failed




7. After the modification, the authorization is successful. as shown in Figure 4
修改之后,授权成功
Figure 4



C:\frp_0.42.0_windows_amd64>.\frpc -c .\frpc.ini
2022/05/11 13:38:31 [I] [service.go:349] [9199f80513ab1df9] login to server success, get run id [9199f80513ab1df9], server udp port [0]
2022/05/11 13:38:31 [I] [proxy_manager.go:144] [9199f80513ab1df9] proxy added: [chengdu-wangqiang-object-local]
2022/05/11 13:38:31 [I] [control.go:181] [9199f80513ab1df9] [chengdu-wangqiang-object-local] start proxy success



8. Edit the nginx configuration file, add Listen 8001; , 8001 is the local service port configured in frpc.ini. Reload the configuration. as shown in Figure 5
编辑 Nginx 配置文件,添加 listen 8001; ,8001 为 frpc.ini 中配置的本地服务端口。重新加载配置
Figure 5


server {
	listen 8001;
    listen 443 ssl;
    server_name x.local;
	...
}


9. Open the URL in the browser: http://chengdu-wangqiang-x-local.frp.x.top/ , and the response is 200. as shown in Figure 6  

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.