cmux icon indicating copy to clipboard operation
cmux copied to clipboard

It's hard to extend protocol

Open drunkpig opened this issue 5 years ago • 3 comments

some protocols are private and strange, so I'd like provide a method to write customer defined protocol Matcher.

drunkpig avatar Oct 14 '20 14:10 drunkpig

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.

drunkpig avatar Oct 14 '20 14:10 drunkpig

(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?

Jille avatar Jan 24 '22 16:01 Jille

maybe you need to Match connections in order, first socks then http

munding avatar Jul 16 '22 07:07 munding