mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-05 21:07:41 +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 {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if version != 4 {
|
if version != 0 {
|
||||||
err = E.New("excepted socks version 4, got ", version)
|
err = E.New("excepted socks4 response version 0, got ", version)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
response.ReplyCode, err = rw.ReadByte(reader)
|
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 {
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue