socks4.go 549 B

1234567891011121314151617181920212223242526272829
  1. package protocol
  2. import (
  3. _ "fmt"
  4. "github.com/v2ray/v2ray-core/common/errors"
  5. _ "github.com/v2ray/v2ray-core/common/log"
  6. )
  7. type SocksVersion4Error struct {
  8. errors.ErrorCode
  9. }
  10. var socksVersion4ErrorInstance = SocksVersion4Error{ErrorCode: 1000}
  11. func NewSocksVersion4Error() SocksVersion4Error {
  12. return socksVersion4ErrorInstance
  13. }
  14. func (err SocksVersion4Error) Error() string {
  15. return err.Prefix() + "Request is socks version 4."
  16. }
  17. type Socks4AuthenticationRequest struct {
  18. Version byte
  19. Command byte
  20. Port uint16
  21. IP [4]byte
  22. }