mirror of
https://github.com/seriyps/mtproto_proxy.git
synced 2026-08-04 07:08:10 +00:00
Use ipv4 when querying IP lookup service
Also, replace broken IP lookup service with some others
This commit is contained in:
parent
30f8c3dbf3
commit
ae618ea478
2 changed files with 6 additions and 3 deletions
|
|
@ -261,8 +261,10 @@ http_get(Url) ->
|
|||
{ok, Vsn} = application:get_key(mtproto_proxy, vsn),
|
||||
UserAgent = "MTProtoProxy/" ++ Vsn ++ " (+https://github.com/seriyps/mtproto_proxy)",
|
||||
Headers = [{"User-Agent", UserAgent}],
|
||||
%% XXX: ipfamily only works on OTP >= 20.3.4; see OTP 2dc08b47e6a5ea759781479593c55bb5776cd828
|
||||
{ok, {{_, 200, _}, _, Body}} =
|
||||
httpc:request(get, {Url, Headers}, [{timeout, 3000}], []),
|
||||
httpc:request(get, {Url, Headers}, [{timeout, 3000}],
|
||||
[{socket_opts, [{ipfamily, inet}]}]),
|
||||
{ok, Body}.
|
||||
|
||||
random_choice(L) ->
|
||||
|
|
|
|||
|
|
@ -31,8 +31,9 @@
|
|||
%% 2nd one will be tried and so on
|
||||
{ip_lookup_services,
|
||||
["http://ipv4.seriyps.ru/",
|
||||
"https://digitalresistance.dog/myIp",
|
||||
"http://ipv4.myexternalip.com/raw"]},
|
||||
"http://v4.ident.me/",
|
||||
"http://ipv4.icanhazip.com/",
|
||||
"https://digitalresistance.dog/myIp"]},
|
||||
%% {external_ip, "YOUR.SERVER.EXTERNAL.IP"},
|
||||
|
||||
%% Interface to listen for incoming connections
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue