mirror of
https://github.com/snail007/goproxy.git
synced 2026-04-27 16:35:49 +03:00
[GH-ISSUE #394] 关于使用代理后的流量问题 #303
Labels
No labels
TODO
bug
duplicate
enhancement
good first issue
help wanted
helpful
invalid
need-confirm
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/goproxy#303
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @plhwin on GitHub (Aug 17, 2020).
Original GitHub issue: https://github.com/snail007/goproxy/issues/394
场景假设:
服务器1位于境外,ip为ip-A,此服务器上跑着程序tcp-server,通过1234端口对外提供服务,主要功能是向已经建立连接的客户端发送tcp socket数据流
服务器2位于境内,ip为ip-B,此服务器上跑着程序tcp-client,此程序通过 ip-A:1234 连接到服务器1
服务器3位于境内,ip为ip-C,此服务器上跑着程序tcp-client,此程序通过 ip-A:1234 连接到服务器1
以上是没有使用代理的情况下的常规方案,我们这里主要关注需要跨境这部分的流量,可以看到有多少个tcp-client连接,就会产生多少份跨境流量,这个场景里是2个client程序,所以产生2份跨境流量。
我们设想另一种方案,增加一个代理服务器P,这个代理服务器也位于境内,假设ip为ip-P,代理服务器通过部署代理程序,使用8080对外提供服务并转发到 ip-A:1234
此时,服务器2和服务器3作为客户端,都分别连接到代理服务器8080端口(最后转向ip-A:1234),我们忽略掉服务器2和服务器3与代理服务器之间产生的2份境内流量,只关心代理服务器与服务器1之间产生的跨境流量,在这个场景里,代理服务器到服务端程序所在服务器1之间产生的跨境流量是1份还是2份?能有只用1份跨境流量的方案吗?
@snail007 commented on GitHub (Aug 17, 2020):
你自己都回答了:
此时,服务器2和服务器3作为客户端,都分别连接到代理服务器8080端口(最后转向ip-A:1234),很明显有多少client流量到达代理P,就有多少流量到达A。@plhwin commented on GitHub (Aug 17, 2020):
嗯,感谢回答,其实更想问的是,面对这种场景,是否有只使用1份跨境流量的方案?(自己再开发一个有针对性的代理程序部署到代理P可以做到,但想问问咱们这里是否存在已有的解决方案,感谢)