8000 Add uTLS Support into V2Ray's TCP and WebSocket transport by xiaokangwang · Pull Request #2219 · v2fly/v2ray-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add uTLS Support into V2Ray's TCP and WebSocket transport #2219

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

Merged
merged 4 commits into from
Dec 24, 2022

Conversation

xiaokangwang
Copy link
Contributor
@xiaokangwang xiaokangwang commented Dec 16, 2022

This is a pull request with the necessary change to add uTLS Support into V2Ray's TCP and WebSocket transport.

You can enable this function with outbound settings like this. The tlsConfig config field is exactly the same as the TLS setting.

 "outbounds": [
    {
      "protocol": "vmess",
      "settings": {
        "address": "",
        "port": 443,
        "uuid": ""
      },
      "streamSettings": {
        "transport": "ws",
        "transportSettings": {
          "path": "?",
          "maxEarlyData": "4096"
        },
        "security": "utls",
        "securitySettings": {
          "imitate": "android_11_okhttp",
          "tlsConfig": {
          }
        }
      }
    }
  ]

It is worth noting, to make sure WebSocket Transport works as expected, ALPN extension was overwritten. This means it may generate additional identification information than uTLS's default configuration(with acknowledgment to The Parrot is Dead paper).

Thanks @HirbodBehnam for the ALPN workaround.

@xiaokangwang xiaokangwang requested a review from kslr December 16, 2022 22:09
@xiaokangwang xiaokangwang changed the title Add uTLS Support into V2Ray's tcp and websocket transport Add uTLS Support into V2Ray's TCP and WebSocket transport Dec 16, 2022
@codecov-commenter
Copy link
codecov-commenter commented Dec 16, 2022

Codecov Report

Base: 39.37% // Head: 39.32% // Decreases project coverage by -0.04% ⚠️

Coverage data is based on head (94aa3df) compared to base (f8ac919).
Patch coverage: 27.27% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2219      +/-   ##
==========================================
- Coverage   39.37%   39.32%   -0.05%     
==========================================
  Files         616      624       +8     
  Lines       36738    36914     +176     
==========================================
+ Hits        14465    14517      +52     
- Misses      20688    20804     +116     
- Partials     1585     1593       +8     
Impacted Files Coverage Δ
app/proxyman/outbound/handler.go 39.72% <0.00%> (-1.12%) ⬇️
transport/internet/security/errors.generated.go 0.00% <0.00%> (ø)
transport/internet/security/security.go 0.00% <0.00%> (ø)
transport/internet/tls/utls/errors.generated.go 0.00% <0.00%> (ø)
transport/internet/tls/utls/nameMapper.go 0.00% <0.00%> (ø)
transport/internet/tls/utls/utls.go 1.92% <1.92%> (ø)
transport/internet/tcp/dialer.go 33.33% <14.28%> (-1.67%) ⬇️
transport/internet/tls/utls/config.pb.go 28.98% <28.98%> (ø)
transport/internet/websocket/dialer.go 22.22% <57.14%> (+3.17%) ⬆️
transport/internet/security/util.go 60.00% <60.00%> (ø)
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@xiaokangwang
Copy link
Contributor Author
xiaokangwang commented Dec 17, 2022

(Still need to make it fail-close and crash when TLS setting is invalid for transport or mode.)(Done)

@r3a1d3a1
Copy link

Hello! Is uTLS compatible with "pinnedPeerCertificateChainSha256" of "tlsSettings" ?

@xiaokangwang
Copy link
Contributor Author

Hello! Is uTLS compatible with "pinnedPeerCertificateChainSha256" of "tlsSettings" ?

Sorry, as of now, pinnedPeerCertificateChainSha256 is not supported in uTLS yet.

@r3a1d3a1
Copy link

Thank you for letting me know.
I'd also really appreciate it if you could reply to this too 🙏

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.

3 participants
0