-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Websocket transport support for v2ray #238
Conversation
Current coverage is 87.70% (diff: 68.66%)@@ master #238 diff @@
==========================================
Files 157 166 +9
Lines 14725 15151 +426
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 12993 13288 +295
- Misses 1320 1428 +108
- Partials 412 435 +23
|
type JsonConfig struct { | ||
ConnectionReuse bool `json:"connectionReuse"` | ||
Path string `json:"Path"` | ||
Pto string `json:"Pto"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does PTO mean? Path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protocol .....
Writing tests now. |
@@ -69,12 +70,25 @@ func (wsl *WSListener) listenws(address v2net.Address, port v2net.Port) error { | |||
errchan := make(chan error) | |||
|
|||
listenerfunc := func() error { | |||
return http.ListenAndServe(address.String()+":"+strconv.Itoa(int(port.Value())), nil) | |||
ol, err := net.Listen("tcp", address.String()+":"+strconv.Itoa(int(port.Value()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ListenTCP here. It removes some unnecessary error checking in NewStoppableListener.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved by 32e8deb
s := make(chan int) | ||
go func() { | ||
buf := make([]byte, 4) | ||
conn.Read(buf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please verify what is read. Same below.
* remove shadowsosks ota * remove unused buf.Reader
Websocket transport implements a HTTP(S) compliable, surveillance proof transport method with plausible deniability.
This transport was disscussed at
#224
https://trello.com/c/3uCCeBkC/8-add-websocket-transport