{"record":{"id":"2548d83eea0cd858","repo":"ginuerzh/gost","slug":"service-unavailable","errorCode":null,"errorMessage":"Service unavailable","messagePattern":"Service unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"socks.go","lineNumber":276,"sourceCode":"\tif err := req.Write(conn); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif Debug {\n\t\tlog.Log(\"[socks5]\", 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]\", reply)\n\t}\n\n\tif reply.Rep != gosocks5.Succeeded {\n\t\treturn nil, errors.New(\"Service unavailable\")\n\t}\n\n\treturn conn, nil\n}\n\ntype socks5BindConnector struct {\n\tUser *url.Userinfo\n}\n\n// SOCKS5BindConnector creates a connector for SOCKS5 bind.\n// It accepts an optional auth info for SOCKS5 Username/Password Authentication.\nfunc SOCKS5BindConnector(user *url.Userinfo) Connector {\n\treturn &socks5BindConnector{User: user}\n}\n\nfunc (c *socks5BindConnector) Connect(conn net.Conn, address string, options ...ConnectOption) (net.Conn, error) {\n\treturn c.ConnectContext(context.Background(), conn, \"tcp\", address, options...)\n}","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/ginuerzh/gost/blob/a33fdbf4c98034f4bfeeaea9868909822b9c526d/socks.go#L258-L294","documentation":"Returned by the SOCKS5 bind connector's ConnectContext (socks.go) when the SOCKS5 server replies to the BIND request with a Rep code other than Succeeded. The error is client-side reporting of a server-side rejection: the proxy accepted the connection but refused or failed to set up the bind listener.","triggerScenarios":"Thrown at socks.go:276 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the SOCKS5 server logs to find why the BIND request was rejected","Verify the target address/port passed in the bind request is reachable and permitted by the proxy's ACL","Confirm the SOCKS5 server supports the BIND command at all","Check that authentication succeeded — some servers report auth failures as a generic non-success Rep"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a33fdbf4c98034f4bfeeaea9868909822b9c526d","analyzedAt":"2026-09-02T22:15:54.506Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}