Skip to content
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

VMess protocol support #632

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

VMess protocol support #632

wants to merge 2 commits into from

Conversation

reflog
Copy link
Contributor

@reflog reflog commented Nov 14, 2024

This PR adds VMess protocol support based on https://github.com/SagerNet/sing-vmess package.

It's fully compatible with v2ray, to test (replaces UUID1,UUID2 with some random uuids):

  1. start http proxy: http-proxy-lantern -cfgsvrauthtoken blabla -vmess-addr 0.0.0.0:7474 -vmess-uuids UUID1,UUID2
  2. start v2ray client: v2ray run -c client.json with the following config
{
  "log": {
    "loglevel": "debug"
  },
  "outbounds": [
    {
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "127.0.0.1",
            "port": 7474,
            "users": [
              {
                "id": "UUID1",
                "security": null
              },
              {
                "id": "UUID2",
                "security": null
              }
            ]
          }
        ]
      }
    }
  ],
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 11083,
      "protocol": "socks"
    }
  ]
}
  1. perform a request curl -x socks5://127.0.0.1:11083 'https://ip.oxylabs.io/location'

P.S. I've also added a CLI option to disable panicwrap, which can be very useful when running under debugger

Copy link
Contributor

@garmr-ulfr garmr-ulfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG! Just a few comments, and VMessAddr should be added here.

For the code in outbound.go and server.go that was copied over, is every function needed? Some aren't referenced anywhere else. Would it still work if we removed them?

v2ray/vmess/outbound.go Outdated Show resolved Hide resolved
v2ray/vmess/outbound.go Outdated Show resolved Hide resolved
v2ray/router.go Outdated Show resolved Hide resolved
v2ray/router.go Show resolved Hide resolved
return err
} else {
if onClose != nil {
onClose(nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

v2ray/vmess/outbound.go Outdated Show resolved Hide resolved
v2ray/vmess/server.go Show resolved Hide resolved
v2ray/vmess/listener_test.go Outdated Show resolved Hide resolved
v2ray/vmess/listener_test.go Outdated Show resolved Hide resolved
v2ray/vmess/listener_test.go Outdated Show resolved Hide resolved
@reflog
Copy link
Contributor Author

reflog commented Nov 21, 2024

@garmr-ulfr thanks for the review. all points addressed

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.

2 participants