{"record":{"id":"d603d224bfe19d60","repo":"ginuerzh/gost","slug":"socks5-mbind-on-s-failure","errorCode":null,"errorMessage":"SOCKS5 mbind on %s failure","messagePattern":"SOCKS5 mbind on (.+?) failure","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"socks.go","lineNumber":520,"sourceCode":"\t\treturn nil, err\n\t}\n\n\tif Debug {\n\t\tlog.Log(\"[socks5] mbind\\n\", req)\n\t}\n\n\treply, err := gosocks5.ReadReply(conn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif Debug {\n\t\tlog.Log(\"[socks5] mbind\\n\", reply)\n\t}\n\n\tif reply.Rep != gosocks5.Succeeded {\n\t\tlog.Logf(\"[socks5] mbind on %s failure\", addr)\n\t\treturn nil, fmt.Errorf(\"SOCKS5 mbind on %s failure\", addr)\n\t}\n\tbaddr, err := net.ResolveTCPAddr(\"tcp\", reply.Addr.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlog.Logf(\"[socks5] mbind on %s OK\", baddr)\n\n\t// Upgrade connection to multiplex stream.\n\tsession, err := smux.Server(conn, smux.DefaultConfig())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &muxSession{conn: conn, session: session}, nil\n}\n\nfunc (tr *socks5MuxBindTransporter) Multiplex() bool {\n\treturn true\n}","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/ginuerzh/gost/blob/a33fdbf4c98034f4bfeeaea9868909822b9c526d/socks.go#L502-L538","documentation":"During mux-bind session setup, initSession sends a SOCKS5 BIND request on the multiplexed session; the server's reply code was not gosocks5.Succeeded, so Handshake aborts with this error. It means the proxy rejected the multiplexed bind for the requested address.","triggerScenarios":"SOCKS5MuxBindTransporter establishing a new mux session (initSession, called from Handshake): the SOCKS5 reply to the mbind request carries a failure code (proxy denies bind, address not permitted, server overloaded).","commonSituations":"Proxy does not support the mux-bind extension; server-side bind host/port misconfigured (bindAddr unreachable or forbidden); proxy ACL rejects the configured bind address; too many concurrent binds.","solutions":["Check the proxy server supports mux-bind and is configured with the same bind address; fix the transporter's bindAddr.","Inspect proxy ACLs and allow the bind address/port.","Retry or reduce concurrent sessions; inspect server logs for the reply code.","Fall back to plain SOCKS5 connector/transporter if the server lacks mux-bind support."],"exampleFix":"// before\nSOCKS5MuxBindTransporter(\"192.168.1.1:6000\") // address rejected by proxy\n// after\nSOCKS5MuxBindTransporter(\"\") // let server choose an allowed bind address, or use an ACL-approved addr","handlingStrategy":"retry","validationCode":"// Verify proxy reachability before Handshake\nconn, err := net.DialTimeout(\"tcp\", proxyAddr, 5*time.Second)\nif err != nil { return err }\nconn.Close()","typeGuard":null,"tryCatchPattern":"session, err := transporter.Handshake(ctx, conn)\nif err != nil {\n\tif strings.Contains(err.Error(), \"mbind on\") {\n\t\t// server refused mux bind: backoff then retry, or fall back to plain connector\n\t\ttime.Sleep(backoff)\n\t\treturn transporter.Handshake(ctx, dialAgain())\n\t}\n\treturn err\n}","preventionTips":["Match the transporter's bindAddr with the proxy's configured bind host.","Confirm server-side mux-bind support before enabling it on the client.","Limit concurrent mux sessions to avoid server-side bind exhaustion."],"tags":["socks5","mux-bind","handshake","proxy-refused"],"backgroundTag":"socks-command-refused","analyzedSha":"a33fdbf4c98034f4bfeeaea9868909822b9c526d","analyzedAt":"2026-09-02T22:15:54.506Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}