Comments (2)
I also found this problem. After reading the code, I found this problem: HTTP1 Matcher tried to read a line and match it in the form of a newline character, while requests like socks did not contain a newline character.
This causes all HTTP1 Matchers to be blocked.
Related code:
Lines 93 to 94 in 5ec6847
from cmux.
I also read the code. HTTP1Fast
use prefixByteMatcher
, then use ReadAtLeast(r Reader, buf []byte, min int)
min
is the max length of HTTP method(CONNECT
or OPTIONS
, just 7 bytes), so it needs to read at least 7 bytes.
but socks first payload usually less than 7 bytes,so it is blocked...
socks5 proto fist payload at least 3 bytes, like below:
# +----+----------+----------+
# |VER | NMETHODS | METHODS |
# +----+----------+----------+
# | 1 | 1 | 1 to 255 |
# +----+----------+----------+
so i change the defaultHTTPMethods
like this (just 3 bytes):
var defaultSimpleHTTPMethods = []string{
"OPT", //OPTIONS
"GET", //GET
"HEA", //HEAD
"POS", //POST
"PUT", //PUT
"DEL", //DELETE
"TRA", //TRACE
"CON", //CONNECT
}
from cmux.
Related Issues (20)
- Upgrade the x/net version in dependencies?
- metrics for mux usage
- Udp support?
- Add benchmarks
- badly-behaved client can deadlock server stopping HOT 3
- Cannot get Matchers to mux h2c gRPC and HTTP2(REST) requests HOT 4
- It's hard to extend protocol HOT 3
- how to write client codeto gprc connect HOT 2
- Doesn't work with grpc-go's hello world example HOT 2
- Pull In Downstream Fixes HOT 1
- Cannot check closed error with errors.Is HOT 1
- Multiplexing gRPC and Prometheus metrics services using Google Cloud Run
- Matching based on URL HOT 1
- Cmux example HOT 1
- Close not working properly on gRPC graceful stop HOT 1
- Multiplexing gRPC & HTTP handlers with H2C+Prior Knowledge HOT 4
- http2 matcher not working with net/http HOT 2
- I don't understand why calling source.Read() might block?
- HTTP1Fast matcher omits PATCH HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmux.