semigodking / redsocks

transparent redirector of any TCP/UDP connection to proxy
Apache License 2.0
1.14k stars 246 forks source link

使用https-connect时报“invalid `type` for redsocks”错误,环境为OpenWrt #158

Open chingxuds opened 3 years ago

chingxuds commented 3 years ago

硬件信息:

主机名 OpenWrt_AC2100
主机型号 Xiaomi Mi Router AC2100
架构 MediaTek MT7621 ver:1 eco:3 x 4
固件版本 OpenWrt R20.9.15 / LuCI Master (git-20.343.54716-6fc079f)

启动时错误信息如下:

file parsing error at line 14: no `type` for redsocks
file parsing error at line 14: section->onexit failed

配置文件如下:

base {
    log_debug = off;
    log_info = off;
    daemon = on;
    redirector= iptables;
}

redsocks {
    bind = "192.168.1.1:1081";
    relay = "10.0.0.1:8080";
    type = https-connect;
    autoproxy = 1;
    timeout = 12;
}

autoproxy {
    no_quick_check_seconds = 60;
    quick_connect_timeout = 3;
}
semigodking commented 3 years ago

这应该是因为编译时没有把相应功能编译进去。

chingxuds notifications@github.com 于 2021年1月18日周一 10:00写道:

硬件信息: 主机名 OpenWrt_AC2100 主机型号 Xiaomi Mi Router AC2100 架构 MediaTek MT7621 ver:1 eco:3 x 4 固件版本 OpenWrt R20.9.15 / LuCI Master (git-20.343.54716-6fc079f)

启动时错误信息如下:

file parsing error at line 14: no type for redsocks

file parsing error at line 14: section->onexit failed

配置文件如下:

base {

log_debug = off;

log_info = off;

daemon = on;

redirector= iptables;

}

redsocks {

bind = "192.168.1.1:1081";

relay = "10.0.0.1:8080";

type = https-connect;

autoproxy = 1;

timeout = 12;

}

autoproxy {

no_quick_check_seconds = 60;

quick_connect_timeout = 3;

}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/semigodking/redsocks/issues/158, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP2XD23S6OX6POCWOECCLTS2OI2VANCNFSM4WGS5E2Q .

chingxuds commented 3 years ago
font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}

我使用的是opkg安装的redsock2

在2021年01月19日 17:41,semigodking<notifications@github.com> 写道: 

这应该是因为编译时没有把相应功能编译进去。

chingxuds notifications@github.com 于 2021年1月18日周一 10:00写道:

硬件信息:

主机名 OpenWrt_AC2100

主机型号 Xiaomi Mi Router AC2100

架构 MediaTek MT7621 ver:1 eco:3 x 4

固件版本 OpenWrt R20.9.15 / LuCI Master (git-20.343.54716-6fc079f)

启动时错误信息如下:

file parsing error at line 14: no type for redsocks

file parsing error at line 14: section->onexit failed

配置文件如下:

base {

log_debug = off;

log_info = off;

daemon = on;

redirector= iptables;

}

redsocks {

bind = "192.168.1.1:1081";

relay = "10.0.0.1:8080";

type = https-connect;

autoproxy = 1;

timeout = 12;

}

autoproxy {

no_quick_check_seconds = 60;

quick_connect_timeout = 3;

}

You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub

https://github.com/semigodking/redsocks/issues/158, or unsubscribe

https://github.com/notifications/unsubscribe-auth/AAP2XD23S6OX6POCWOECCLTS2OI2VANCNFSM4WGS5E2Q

.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

semigodking commented 3 years ago

我没使用过这种方式安装,所以也不知道它默认是否包含https的支持。 比较简单的检查方式是 strings path/to/redsocks2 |grep ssl

如果支持就能看到ssl相关的一些输出。

chingxuds notifications@github.com 于 2021年1月19日周二 18:19写道:

font{ line-height: 1.6; } ul,ol{ padding-left: 20px; list-style-position: inside; }

我使用的是opkg安装的redsock2

在2021年01月19日 17:41,semigodkingnotifications@github.com 写道:

这应该是因为编译时没有把相应功能编译进去。

chingxuds notifications@github.com 于 2021年1月18日周一 10:00写道:

硬件信息:

主机名 OpenWrt_AC2100

主机型号 Xiaomi Mi Router AC2100

架构 MediaTek MT7621 ver:1 eco:3 x 4

固件版本 OpenWrt R20.9.15 / LuCI Master (git-20.343.54716-6fc079f)

启动时错误信息如下:

file parsing error at line 14: no type for redsocks

file parsing error at line 14: section->onexit failed

配置文件如下:

base {

log_debug = off;

log_info = off;

daemon = on;

redirector= iptables;

}

redsocks {

bind = "192.168.1.1:1081";

relay = "10.0.0.1:8080";

type = https-connect;

autoproxy = 1;

timeout = 12;

}

autoproxy {

no_quick_check_seconds = 60;

quick_connect_timeout = 3;

}

You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub

https://github.com/semigodking/redsocks/issues/158, or unsubscribe

< https://github.com/notifications/unsubscribe-auth/AAP2XD23S6OX6POCWOECCLTS2OI2VANCNFSM4WGS5E2Q

.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/semigodking/redsocks/issues/158#issuecomment-762746046, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP2XD32D6YA4RSD2LTN353S2VMCJANCNFSM4WGS5E2Q .

chingxuds commented 3 years ago
font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}

查询应该是有相关支持的,而且版本也是最新的

在2021年01月19日 18:31,semigodking<notifications@github.com> 写道: 

我没使用过这种方式安装,所以也不知道它默认是否包含https的支持。

比较简单的检查方式是

strings path/to/redsocks2 |grep ssl

如果支持就能看到ssl相关的一些输出。

chingxuds notifications@github.com 于 2021年1月19日周二 18:19写道:

font{

line-height: 1.6;

}

ul,ol{

padding-left: 20px;

list-style-position: inside;

}

我使用的是opkg安装的redsock2

在2021年01月19日 17:41,semigodkingnotifications@github.com 写道:

这应该是因为编译时没有把相应功能编译进去。

chingxuds notifications@github.com 于 2021年1月18日周一 10:00写道:

硬件信息:

主机名 OpenWrt_AC2100

主机型号 Xiaomi Mi Router AC2100

架构 MediaTek MT7621 ver:1 eco:3 x 4

固件版本 OpenWrt R20.9.15 / LuCI Master (git-20.343.54716-6fc079f)

启动时错误信息如下:

file parsing error at line 14: no type for redsocks

file parsing error at line 14: section->onexit failed

配置文件如下:

base {

log_debug = off;

log_info = off;

daemon = on;

redirector= iptables;

}

redsocks {

bind = "192.168.1.1:1081";

relay = "10.0.0.1:8080";

type = https-connect;

autoproxy = 1;

timeout = 12;

}

autoproxy {

no_quick_check_seconds = 60;

quick_connect_timeout = 3;

}

You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub

https://github.com/semigodking/redsocks/issues/158, or unsubscribe

<

https://github.com/notifications/unsubscribe-auth/AAP2XD23S6OX6POCWOECCLTS2OI2VANCNFSM4WGS5E2Q

.

—You are receiving this because you authored the thread.Reply to this

email directly, view it on GitHub, or unsubscribe.

You are receiving this because you commented.

Reply to this email directly, view it on GitHub

https://github.com/semigodking/redsocks/issues/158#issuecomment-762746046,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AAP2XD32D6YA4RSD2LTN353S2VMCJANCNFSM4WGS5E2Q

.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

semigodking commented 3 years ago

应该是编译时没有加这个参数ENABLE_HTTPS_PROXY make ENABLE_HTTPS_PROXY=true

Ansen commented 7 months ago

有个差得多的错误😂,

从源里面安装和我自己按照Zhuo 的文档编译的包,也会有这个问题

image

这个文件总共才15行

base {
  log_debug = off;
  log_info = on;
  daemon = on;
  redirector= iptables;
}
redsocks {
  bind = "0.0.0.0:1081";
  relay = "xx";
  type = socks5;
  timeout = 12;
  autoproxy = 1;
  login = "xxx";
  password = "xx";
}
[root@OpenWrt:06:26 PM /etc/redsocks] # strings /usr/sbin/redsocks2 | grep socks5
socks5_strstatus
socks5_is_valid_cred
socks5_mkmethods_plain
socks5_mkpassword_plain
socks5_mkcommand_plain
socks5_is_known_auth_method
socks5_status_to_str
socks5.c
socks5_is_known_auth_method: %s
socks5
socks5_read_reply
socks5_read_auth_reply
socks5_read_auth_methods
socks5_mkmethods_plain
socks5_is_valid_cred
socks5-udp.c
socks5_relay_error
fd == event_get_fd(&socks5client->udprelay)
socks5_client_fini
socks5_pkt_from_socks
socks5_read_assoc_reply
socks5_read_auth_reply
socks5_read_auth_methods
socks5_relay_connected
socks5_relay_error
socks5_forward_pkt
semigodking commented 7 months ago

我重现不了

On Mon, Nov 20, 2023, 18:24 An @.***> wrote:

同样的错误,

从源里面安装和我自己按照Zhuo https://github.com/AlexZhuo/openwrt-redsocks2 的文档编译的包,也会有这个问题

[image: image] https://user-images.githubusercontent.com/676412/284233884-e8d2db92-6fda-4908-aad1-fc4d7c6f340f.png

这个文件总共才15行

base { log_debug = off; log_info = on; daemon = on; redirector= iptables; } redsocks { bind = "0.0.0.0:1081"; relay = "xx"; type = socks5; timeout = 12; autoproxy = 1; login = "xxx"; password = "xx"; }

— Reply to this email directly, view it on GitHub https://github.com/semigodking/redsocks/issues/158#issuecomment-1818770335, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP2XD6MBRVGKC35TSEEZ5LYFMVXTAVCNFSM4WGS5E22U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRHA3TOMBTGM2Q . You are receiving this because you commented.Message ID: @.***>

Ansen commented 7 months ago

感谢回复,可能是我昨天哪里没有编译正确,今天根据文档的说明,简单写了一个脚本编译,就没问题了

#!/bin/bash

openwrt_sdk_url='https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt7621/openwrt-sdk-21.02.3-ramips-mt7621_gcc-8.4.0_musl.Linux-x86_64.tar.xz'
openwrt_sdk_filename=$(basename "${openwrt_sdk_url}")
uncompress_dir=$(echo "openwrt_sdk_filename" | sed  's/.tar.xz$//g')

rm -rf "${uncompress_dir}"
if [[ !-f "${openwrt_sdk_filename}" ]]
then
    wget "${openwrt_sdk_url}"
fi
tar xf "${openwrt_sdk_filename}"
cd "${uncompress_dir}"
git clone https://github.com/AlexZhuo/openwrt-redsocks2.git package/redsocks2
# 使用最新的 commit hash id
sed -i 's/3052eeab75ff1ebd20c22334fbbecd808525bca7/f5b1b820d6be8eafdbebb73a884bce61146b0e42/g' package/redsocks2/Makefile
# 更新版本号为 commit hash id 前六位
sed -i 's/0.67/f5b1b82/g' package/redsocks2/Makefile

# 安装依赖包源码
./scripts/feeds update base
./scripts/feeds install libevent2
./scripts/diffconfig.sh
rm -rf package/feeds
git clone https://github.com/AlexZhuo/openwrt-feeds.git package/feeds

# 第一次需要手动运行
# make menuconfig
# 第二次运行,直接使用第一次生成的 .config
cp ../config ./.config
make package/redsocks2/compile V=99

if [[ $? -eq 0 ]] 
then
    echo "编译成功"
    echo "请进入 $(pwd)/bin/packages/mipsel_24kc/base 中查看文件"
else
    echo "编译失败"
fi

我重现不了 On Mon, Nov 20, 2023, 18:24 An @.> wrote: 同样的错误, 从源里面安装和我自己按照Zhuo https://github.com/AlexZhuo/openwrt-redsocks2 的文档编译的包,也会有这个问题 [image: image] https://user-images.githubusercontent.com/676412/284233884-e8d2db92-6fda-4908-aad1-fc4d7c6f340f.png 这个文件总共才15行 base { log_debug = off; log_info = on; daemon = on; redirector= iptables; } redsocks { bind = "0.0.0.0:1081"; relay = "xx"; type = socks5; timeout = 12; autoproxy = 1; login = "xxx"; password = "xx"; } — Reply to this email directly, view it on GitHub <#158 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP2XD6MBRVGKC35TSEEZ5LYFMVXTAVCNFSM4WGS5E22U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRHA3TOMBTGM2Q . You are receiving this because you commented.Message ID: @.>