headers.go 781 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package protocol
  2. import (
  3. v2net "github.com/v2ray/v2ray-core/common/net"
  4. "github.com/v2ray/v2ray-core/common/serial"
  5. "github.com/v2ray/v2ray-core/common/uuid"
  6. )
  7. type RequestCommand byte
  8. const (
  9. RequestCommandTCP = RequestCommand(0x01)
  10. RequestCommandUDP = RequestCommand(0x02)
  11. )
  12. type RequestOption byte
  13. const (
  14. RequestOptionChunkStream = RequestOption(0x01)
  15. )
  16. type RequestHeader struct {
  17. Version byte
  18. User *User
  19. Command RequestCommand
  20. Option RequestOption
  21. Address v2net.Address
  22. Port v2net.Port
  23. }
  24. type ResponseCommand interface{}
  25. type ResponseHeader struct {
  26. Command ResponseCommand
  27. }
  28. type CommandSwitchAccount struct {
  29. Host v2net.Address
  30. Port v2net.Port
  31. ID *uuid.UUID
  32. AlterIds serial.Uint16Literal
  33. Level UserLevel
  34. ValidMin byte
  35. }