Conversation
imgk
reviewed
May 14, 2025
app/unix_proxy.go
Outdated
| // UnixProxy is ... | ||
| type UnixProxy struct { | ||
| Path string `json:"path"` | ||
| trojan.Dialer `json:"-,omitempty"` |
| // +------------------+--------+--------------+------------+-------------+-------------+--------+ | ||
| // | ||
| // * AddrLen only exists when AddrType = 0x03 (domain) | ||
| func writeTrojanUnixHandshake(conn net.Conn, network, addr string) error { |
Owner
There was a problem hiding this comment.
我不太了解 magic "caddy-trojan" 设置的原因,那对应的服务端是不通用的吗?只有特定服务端才支持?
Contributor
Author
There was a problem hiding this comment.
这个是为了标识来自于你这个插件。理论上来说这个是你这个插件特有的
751a23e to
23cef75
Compare
Owner
|
增加一下 caddyfile 解析的部分吧,现在应该还是不支持的 |
imgk
reviewed
May 14, 2025
Contributor
Author
There was a problem hiding this comment.
文件名已改
caddyfile 解析也增加了
Contributor
Author
Owner
There was a problem hiding this comment.
其实我想说的是没有必要在结构体定义 trojan.Dialer,不仅仅是 json的部分,我看这个Dialer没在其他地方用到
Contributor
Author
23cef75 to
2a91b5e
Compare
2a91b5e to
3f2b7b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


sequenceDiagram participant Client participant CaddyTrojan participant LocalRelay participant TargetServer Client->>CaddyTrojan: 建立 trojan 连接 CaddyTrojan->>LocalRelay: 使用 Unix Socket 转发请求 LocalRelay->>TargetServer: 封装私有协议,请求目标服务 TargetServer-->>LocalRelay: 返回响应数据 LocalRelay-->>CaddyTrojan: 通过 Unix Socket 传回响应 CaddyTrojan-->>Client: 返回最终数据