我如何为IPv6地址配置tinyproxy的上游?
以下内容不起作用。
Upstream "[2001:xxxx:xxx:xx:xxx:xxxx:xxxx:380f]:8888"我得到以下错误:Unable to parse config file. Not starting.
发布于 2023-02-11 01:34:48
上游的正确语法是:
Upstream http "[2001:xxxx:xxx:xx:xxx:xxxx:xxxx:380f]:8888"你只是错过了http。
发布于 2023-05-04 07:23:30
我试过了
upstream http "[fe80::1]:8888"但我也得到了一个错误:
ERROR: Syntax error on line 157
Unable to parse config file. Not starting.看起来小代理(至少1.11.1版本)不支持IPv6地址。
src/con.c:
#define IP "((([0-9]{1,3})\\.){3}[0-9]{1,3})"
...
#ifdef UPSTREAM_SUPPORT
STDCONF (upstream,
"(" "(none)" WS STR ")|" \
"(" "(http|socks4|socks5)" WS \
"(" USERNAME /*username*/ ":" PASSWORD /*password*/ "@" ")?"
"(" IP "|" ALNUM ")"
":" INT "(" WS STR ")?" ")", handle_upstream),
#endif在IP中定义的正则表达式#仅与数值IPv4地址匹配。
我更改了conf.c .c以包括IPv6地址:
STDCONF (upstream,
"(" "(none)" WS STR ")|" \
"(" "(http|socks4|socks5)" WS \
"(" USERNAME /*username*/ ":" PASSWORD /*password*/ "@" ")?"
"(" IP "|" "\\[" IPV6 "\\]" "|" ALNUM ")"
":" INT "(" WS STR ")?" ")", handle_upstream),我还从config语句中删除了双引号:
upstream http [fe80::1]:8888现在,tinyproxy开始时对其配置文件没有抱怨。但是我没有检查,上游连接是否真的起作用,或者是否需要使用IPv6地址作为上游代理。我的主要嫌疑人是,我可能需要把数字IPv6地址中的方格去掉。
https://serverfault.com/questions/759545
复制相似问题