Skip to content

[WIP] Fix incorrect listening port issue with Shadowsocks-Rust plugin - #24

Draft
madeye with Claude wants to merge 2 commits into
masterfrom
claude/fix-listening-port-issue
Draft

[WIP] Fix incorrect listening port issue with Shadowsocks-Rust plugin#24
madeye with Claude wants to merge 2 commits into
masterfrom
claude/fix-listening-port-issue

Conversation

@Claude

@Claude Claude AI commented Aug 3, 2026

Copy link
Copy Markdown

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>作为插件配合 shadowsocks-rust 使用时监听端口不正确的问题</issue_title>
<issue_description>以下是配置文件的关键部分:

        // 服务端
        {
            "server": "0.0.0.0",
            "server_port": 2047,
            "password": "${SHADOWSOCKS_PASSWORD}",
            "method": "chacha20-ietf-poly1305",
            "mode": "tcp_only",
            "plugin": "qtun-server",
            "plugin_opts": "acme_host=my.domain.com"
        },

        // 客户端
        {
            "server": "xxx.xxx.xxx.xxx",
            "server_port": 2047,
            "password": "${SHADOWSOCKS_PASSWORD}",
            "method": "chacha20-ietf-poly1305",
            "mode": "tcp_only",
            "plugin": "qtun-client",
            "plugin-opts": "host=my.domain.com"
        },

启动命令分别为:

ssservice server --config ./server.json -v
ssservice local --config ./local.json -v

日志里出现了:

2023-02-02T15:03:33.354735714+08:00 DEBUG [298:139989240718384] [shadowsocks::plugin] started plugin "qtun-client" on 127.0.0.1:34297 <-> xxx.xxx.xxx.xxx:2047 (302)
[2023-02-02T07:03:33Z INFO  qtun_client] listening on 127.0.0.1:8138

root@OpenWrt:~# netstat -nap | grep qtun-client
tcp        0      0 127.0.0.1:8138          0.0.0.0:*               LISTEN      5027/qtun-client
udp        0      0 :::50575                :::*                                5027/qtun-client
unix  3      [ ]         STREAM     CONNECTED     2072588 5027/qtun-client
unix  3      [ ]         STREAM     CONNECTED     2072589 5027/qtun-client

此时 qtun-client 监听的端口应该为 34297, 但实际监听了 8138.

相关问题:shadowsocks/shadowsocks-rust#1104</issue_description>

<agent_instructions>fix the issue.</agent_instructions>

Comments on the Issue (you are @claude[agent] in this section)

@madeye Can you try the command line options first?

Server

./ssserver -s 0.0.0.0:443 -k example -m aes-256-gcm --plugin ./qtun-server --plugin-opts "acme_host=example.com"

Client

./sslocal -s example.com:443 -k example -m aes-256-gcm --plugin ./qtun-client --plugin-opts "host=example.com"
```</body></comment_new>
<comment_new><author>@madeye</author><body>
If so, the `SS_LOCAL_HOST` and `SS_LOCAL_PORT` environment variables should be parsed correctly in qtun-client.

Guess there's something wrong in ss-rust while launching multiple SIP003 plugins. Can you try v2ray-plugin's quic mode as well?</body></comment_new>
</comments>

@Claude
Claude AI requested a review from madeye August 3, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

作为插件配合 shadowsocks-rust 使用时监听端口不正确的问题

2 participants