-
Notifications
You must be signed in to change notification settings - Fork 557
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
Transport plugin with websocket #139
Comments
Hmmm, I think connection reuse would be very useful (and more realistic to actual WebSockets IMO) here, especially if considering having CDN. I took a quick look and I don't think any of these implements this feature. |
Why don't you guys even take a look at V2Ray? |
@VictoriaRaymond Yeah, I knew V2Ray can do this. But it makes no sense to use V2Ray as a plugin of shadowsocks. 😸 |
It is possible to run V2Ray in transport mode (i.e., without proxy protocol involved) as a plugin. It can tunnel for example socks <-> websocket, and can do connection reuse as suggested. I am not aware of any other existing software that provides similar functionalities. |
Okay, it may be not a bad idea to employ v2ray as a transport plugin.
Tried it locally and worked as expected. |
As a reference, here is a minimum config to run V2Ray as plugin, with mux enabled, and without proxy protocol. It has the following restrictions:
Client config:{
"log": {
// Log level, one of "debug", "info", "warning", "error", "none"
"loglevel": "info"
},
"inbounds": [{
// port for listening connections from ss
"port": 9999,
"listen": "127.0.0.1",
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"network": "tcp"
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {
// v2ray server address
"redirect": "<server_ip>:8888"
},
"streamSettings": {
"network": "ws",
"wsSettings": {
// WebSocket path. Must match between client and server.
"path": "/test",
"headers": {
// Customizable headers.
"Host": "v2ray.com"
}
}
},
"mux": {
// For connection reuse.
"enabled": true
}
}]
} Server config:{
"log": {
// Log level, one of "debug", "info", "warning", "error", "none"
"loglevel": "info"
},
"inbounds": [{
// V2Ray server port.
"port": 8888,
"listen": "0.0.0.0",
"protocol": "dokodemo-door",
"settings": {
// This address is required when mux is used on client.
// dokodemo-door is not aware of mux connections by itself.
// Change this value to 127.0.0.1 if mux is disabled.
"address": "v1.mux.cool",
"network": "tcp"
},
"streamSettings": {
"network": "ws",
"wsSettings": {
// WebSocket path
"path": "/test",
"headers": {
"Host": "v2ray.com"
}
}
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {
// ss server address
"redirect": "127.0.0.1:7777"
}
}]
} |
Cool! Just follow @VictoriaRaymond's config and build a SIP003 plugin here: https://github.com/madeye/v2ray-plugin |
It looks weird that I saw too many open files error, though I enabled mux in the config file and verified mux works with tcpdump.
@VictoriaRaymond Any idea? |
@VictoriaRaymond It looks v2ray cannot close spider or port scanner's HTTP connections correctly.
|
There are several timeout settings in your scenarion:
I guess you are hitting either case 1 or 4. I will fix case 1 soon. |
Yeah, it looks related to case 1. Looking forward to the fix. |
Case 1 is fixed in v2ray/v2ray-core@6146366 |
So I guess we are officially collaborating with @v2ray now? Very cool. 🤣 I'm very excited to give the new plugin a spin, especially QUIC and TLS. I will probably do it a few days later when I get the time to do so. Reading the docs, I'm confused by the obfuscation type in QUIC transport. Isn't QUIC transport supposed to mimic the traffic of QUIC? How does it mimic other types of traffic at the same time? Also why is there a |
Both settings are optional btw. You may use pure Quic by leaving both settings unset. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Alright, sorry about having been off-topic. I hided the off-topic comments (this is a great feature) and moved the discussions (my points at least) to v2ray/discussion. Anyway, I'll check this v2ray-plugin sometime. Good work, everyone. 😅 |
Just add a new Android plugin here: https://github.com/madeye/v2ray-plugin-android |
I think we can close this now. |
Can we also deprecate simple-obfs (meaning add a notice and archive simple-obfs and simple-obfs-android) as well? That code is quite an eyesore. For anyone that's interested, |
Yes, we should deprecate simple-obfs. Maybe v2ray already do failover with some configs. |
Hmmm, I don't think so. |
Don't know what V2Ray doesn't have such functionality. Instead, V2Ray relies on a Web server (caddy for example, as mentioned by @Mygod ) to filter out invalid requests. There is a feature request for this. |
Given the typical usage of this plugin is with a CDN, the Just enable the CDN's URL overwrite feature and routing default path to some "common" website. |
Well just in case my point wasn't clear, I meant to say there is no need to include |
Here's a basic example of setting it up behind caddy just in case. v2ray-plugin options:
Note that server operates in HTTP mode and client in TLS. |
Sorry for late, but what about Session Ticket obfuscation? V2Ray never implemented it. |
I tried https://github.com/erebe/wstunnel as a transport plugin recently. By tunneling shadowsocks traffic on websocket and accelerated by CDN, the performance looks quite good.
If anyone interested, a new plugin (written in golang is preferred) with websocket (https://github.com/gorilla/websocket) is welcome.
The text was updated successfully, but these errors were encountered: