set smux version to 1
This commit is contained in:
@ -13,12 +13,20 @@ import (
|
||||
|
||||
// Bind implements connector.Binder.
|
||||
func (c *tunnelConnector) Bind(ctx context.Context, conn net.Conn, network, address string, opts ...connector.BindOption) (net.Listener, error) {
|
||||
log := c.options.Logger
|
||||
|
||||
addr, cid, err := c.initTunnel(conn, network, address)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
endpoint := addr.String()
|
||||
if v, _, _ := net.SplitHostPort(addr.String()); v != "" {
|
||||
endpoint = v
|
||||
}
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"endpoint": endpoint,
|
||||
"tunnel": c.md.tunnelID.String(),
|
||||
})
|
||||
log.Infof("create tunnel on %s/%s OK, tunnel=%s, connector=%s", addr, network, c.md.tunnelID.String(), cid)
|
||||
|
||||
session, err := mux.ServerSession(conn, c.md.muxCfg)
|
||||
|
@ -51,6 +51,9 @@ func (c *tunnelConnector) parseMetadata(md mdata.Metadata) (err error) {
|
||||
MaxReceiveBuffer: mdutil.GetInt(md, "mux.maxReceiveBuffer"),
|
||||
MaxStreamBuffer: mdutil.GetInt(md, "mux.maxStreamBuffer"),
|
||||
}
|
||||
if c.md.muxCfg.Version == 0 {
|
||||
c.md.muxCfg.Version = 2
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user