-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socks inbound: Support HTTP inbound by default #3682
Conversation
|
就是说别套一层了,看着头大,直接在 Socks 内部处理逻辑那里分流给 HTTP 就行了 |
em 主要是curl会用GET 改一下也行 改成G或者E吧 或者直接改成非5开头就进http 这样更简单 string都免了 我也这么想过不过想着这牌子还是SOCKS 能进SOCKS尽量SOCKS5
直接复用http入站的Process函数是最方便的了 还里面就要处理更多函数了 感觉只会更乱 |
套一层的话性能会打折,splice 还会炸,你给俩 process 都加个参数传首字节吧, |
I don't have any strong opinions on the interface, it seems that if socks is compatible with http by default, the entire http inbound can be deleted as well? (and it just becomes an alias for socks) |
我觉得 Socks 可以默认兼容 HTTP 但反过来不妥,因为 HTTP 代理一定是域名, |
OK 现在是直接从连接里读出一个字节来 我修改了两个process函数让它们的reader接上firstbyte |
em 不能随意修改process签名 套了一层娃 |
this construction is not helpful right? Xray-core/transport/internet/splithttp/dialer.go Lines 304 to 316 in f0547bc
because it will not work with splice... |
|
|
|
这样么 昨晚上没看清从http复制来的 socks 这里确实用一个 io.Reader 就行了 |
|
还有我看了下,HTTP 的两个 buf.Copy 基于 conn,但 Socks 的第一个 buf.Copy 基于旧的 reader,顺便改成基于 conn 吧 |
@Fangliding 别水群了,快改代码 |
|
|
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
好了,下个版本的 Xray-core,Socks 入站默认兼容 HTTP 入站,反过来不是,理由详见 #3682 (comment) |
@Fangliding 改 Socks 入站文档,下个版本是 v1.8.24 |
等下,好像不能这么改,@Fangliding 你把这部分 revert 后重新 commit 到 main 吧 |
revert还是reset |
|
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
虽然正常的 Socks5 有 1-RTT 的握手, 我看了下 BufferedReader 读完 Buffer 后的 ReadMultiBuffer() 也挺干净的, |
@Fangliding 只还原 s.transport 那里,上面的别还原, |
@Fangliding 就是只还原这个 commit 02a691a 从158 行开始的修改, |
@Fangliding 不是,你看上面 BufferedReader 那里,所以说要先看懂, |
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
|
|
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
|
@RPRX 也关不掉吧() |
我试了下,看日志可以区分出来是 Socks 还是 HTTP,前者有标明 tcp/udp,后者没有, 然后我早就觉得 *ray 的日志有点怪,就是说少了个 from 字样,补上了,类似于 Trojan-killer:XTLS/Trojan-killer#10 (comment) |
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
RT 允许socks入站使用http,不是从HTTP inbound copy来的,而是调用http入站本身
兼容鉴权(如果socks5设置了密码 http也需要一样的密码才能访问)
默认开启
eg: