Open drunkpig opened 3 years ago
besids this , cmux use first N bytes to seperate protocol, N is various。 When cmux match protocol in the order of http(use first 8 bytes) then socks5(use first byte) , the socks handler will never reached! The reason is Matcher is blocked at http Matcher, it will never read all first 8 bytes.
(I have little experience with cmux, but) can't you just create your own matcher by defining a func(io.Reader) bool
and using that?
maybe you need to Match connections in order, first socks then http
some protocols are private and strange, so I'd like provide a method to write customer defined protocol Matcher.