首页
/
每日頭條
/
科技
/
frp内網服務搭建
frp内網服務搭建
更新时间:2024-07-30 21:21:31

公司有一個業務場景,需要利用分布在全國各地的一些手機作為代理服務器

拿到這任務的我是一臉懵逼的,這tm都行。。。

不過這讓我讓我想到之前用的内網穿透 frp

内網穿透大緻原理可看我之前文章

大白話告訴你内網穿透原理和驗證

搭建環境條件
  • 公網服務器
  • 安卓手機
  • frp 服務端包和客戶端的包
公網服務器配置

下載frp 和linux amd64位的包

Releases · fatedier/frp · GitHub

frp内網服務搭建(基于frp實現将安卓手機變成代理服務器)1

上傳到公網服務器解壓

frps.init 配置如下

[common] #服務端口 bind_port = 7000 bind_addr = 0.0.0.0 privilege_token = frp

啟動frps

./frps -c frps.ini

啟動成功日志如下

2021/07/28 17:49:45 [I] [root.go:200] frps uses config file: frps.ini 2021/07/28 17:49:45 [I] [service.go:192] frps tcp listen on 0.0.0.0:7000 2021/07/28 17:49:45 [I] [service.go:235] http service listen on 0.0.0.0:6001 2021/07/28 17:49:45 [I] [root.go:209] frps started successfully

安卓手機

此時需要下載 `frp_android` 的apk

GitHub - mainfunx/frpc_android: frpc_android 最新版本0.39.1

然後添加配置文件

[common] server_addr = 118.33.22.188 server_port = 7000 auto_token = frp [http_proxy] type = tcp remote_port = 6003 # 代理插件 plugin = http_proxy

frp内網服務搭建(基于frp實現将安卓手機變成代理服務器)2

然後右下角按鈕啟動

frp内網服務搭建(基于frp實現将安卓手機變成代理服務器)3

這時查看公網服務器日志看到變化成功即可

frp内網服務搭建(基于frp實現将安卓手機變成代理服務器)4

## 驗證

frp内網服務搭建(基于frp實現将安卓手機變成代理服務器)5

這樣就OK了

擴展

如果要實現多個客戶端需要隻需要修改安卓客戶端配置文件即可

[common] server_addr = 118.33.22.188 server_port = 7000 auto_token = frp # 配置名必須要不一樣 [http_proxy_1] type = tcp #端口也得改 remote_port = 6004 # 代理插件 plugin = http_proxy

# 遺憾

1. 這個雖然簡單方便,但是需要一台公網服務器,不适合個人用戶

2. 不是高度匿名,訪問速度也一般

個人用戶或者要高速的可以嘗試

如何用安卓手機做代理服務器_Ghost幽靈的博客-CSDN博客_手機代理服務器

,
Comments
Welcome to tft每日頭條 comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
Copyright 2023-2024 - www.tftnews.com All Rights Reserved