mirror of
https://github.com/soheilhy/cmux.git
synced 2024-11-14 11:31:28 +08:00
support proxy protocol
This commit is contained in:
parent
7303c90c48
commit
225edbee33
4
cmux.go
4
cmux.go
@ -187,6 +187,10 @@ func (m *cMux) serve(c net.Conn, donec <-chan struct{}, wg *sync.WaitGroup) {
|
|||||||
if m.readTimeout > noTimeout {
|
if m.readTimeout > noTimeout {
|
||||||
_ = c.SetReadDeadline(time.Now().Add(m.readTimeout))
|
_ = c.SetReadDeadline(time.Now().Add(m.readTimeout))
|
||||||
}
|
}
|
||||||
|
if err := muc.checkPrefix(); err != nil {
|
||||||
|
_ = c.Close()
|
||||||
|
return
|
||||||
|
}
|
||||||
for _, sl := range m.sls {
|
for _, sl := range m.sls {
|
||||||
for _, s := range sl.ss {
|
for _, s := range sl.ss {
|
||||||
matched := s(muc.Conn, muc.startSniffing())
|
matched := s(muc.Conn, muc.startSniffing())
|
||||||
|
Loading…
Reference in New Issue
Block a user