mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-04 20:37:40 +03:00
Fix socks4 response
This commit is contained in:
parent
eeac9e8a1e
commit
4ce9815aca
1 changed files with 3 additions and 3 deletions
|
@ -120,8 +120,8 @@ func ReadResponse(reader io.Reader) (response Response, err error) {
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
if version != 4 {
|
||||
err = E.New("excepted socks version 4, got ", version)
|
||||
if version != 0 {
|
||||
err = E.New("excepted socks4 response version 0, got ", version)
|
||||
return
|
||||
}
|
||||
response.ReplyCode, err = rw.ReadByte(reader)
|
||||
|
@ -142,7 +142,7 @@ func ReadResponse(reader io.Reader) (response Response, err error) {
|
|||
}
|
||||
|
||||
func WriteResponse(writer io.Writer, response Response) error {
|
||||
_, err := writer.Write([]byte{Version, response.ReplyCode})
|
||||
_, err := writer.Write([]byte{0, response.ReplyCode})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue