mirror of
https://github.com/snail007/goproxy.git
synced 2026-04-27 00:15:51 +03:00
[GH-ISSUE #170] 转发到动态IP的问题 #100
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#100
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 @hejiadong0608 on GitHub (Nov 4, 2018).
Original GitHub issue: https://github.com/snail007/goproxy/issues/170
使用的软件版本为6.4。
由于我使用的服务对带宽要求比较高,正好家里可以满足需求,所以用树莓派建立了这个服务。但是移动宽带连接到电信宽带非常不稳定,加上手里正好有几台腾讯云1M带宽的服务器,就拿来中转一下,达到稳定连接的目的。
因为家庭宽带都是动态IP,我用了域名来解决需要手动更换IP的问题,proxy的运行命令为:
proxy tcp -p ":10333" -T tcp -P "home.example.com:10333" --forever --daemon
现在的问题是,当IP有变化时,proxy那边就无法正常连接了,只能重启转发服务。
请问,有什么方法可以自动解决这个问题,谢谢。
@snail007 commented on GitHub (Nov 4, 2018):
这决定于系统dns更新时间,proxy解决不了dns问题。
@hejiadong0608 commented on GitHub (Nov 4, 2018):
您好!
根据我的判断,跟DNS应该没有关系。可能我的表达还不够清楚。
今天早上,运营商给我重新分配了IP地址。因为腾讯云的服务器在之后的几个小时里一直没有使用,所以我一直都不知道中转服务器已经连接不上了。到了下午四点多,才发现了这个问题。
此时我登陆到服务器,去ping我的域名,得到的是正确的IP地址,但是proxy的转发端口还是无法连接,必须结束进程,重新运行转发命令之后才能成功连接上。
@hejiadong0608 commented on GitHub (Nov 5, 2018):
@snail007
@zhfish commented on GitHub (Dec 20, 2018):
home.example.com在启动的时候就会被解析成ip,所以没有人会用动态ip做server
你可以起个定时任务,如果域名指向的ip有变化,那么重启这个proxy
和ddns一个道理
@mrshelly commented on GitHub (Jan 12, 2019):
nginx 可以设置 dns cache 时间,所以转发时 做个 dns 查询就可以了,建议功能加上
@hktalent commented on GitHub (Jan 23, 2019):
@hejiadong0608 启动,绑定IP、:
0.0.0.0