config.pb.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.36.11
  4. // protoc v6.33.5
  5. // source: proxy/socks/config.proto
  6. package socks
  7. import (
  8. net "github.com/xtls/xray-core/common/net"
  9. protocol "github.com/xtls/xray-core/common/protocol"
  10. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  11. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  12. reflect "reflect"
  13. sync "sync"
  14. unsafe "unsafe"
  15. )
  16. const (
  17. // Verify that this generated code is sufficiently up-to-date.
  18. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  19. // Verify that runtime/protoimpl is sufficiently up-to-date.
  20. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  21. )
  22. // AuthType is the authentication type of Socks proxy.
  23. type AuthType int32
  24. const (
  25. // NO_AUTH is for anonymous authentication.
  26. AuthType_NO_AUTH AuthType = 0
  27. // PASSWORD is for username/password authentication.
  28. AuthType_PASSWORD AuthType = 1
  29. )
  30. // Enum value maps for AuthType.
  31. var (
  32. AuthType_name = map[int32]string{
  33. 0: "NO_AUTH",
  34. 1: "PASSWORD",
  35. }
  36. AuthType_value = map[string]int32{
  37. "NO_AUTH": 0,
  38. "PASSWORD": 1,
  39. }
  40. )
  41. func (x AuthType) Enum() *AuthType {
  42. p := new(AuthType)
  43. *p = x
  44. return p
  45. }
  46. func (x AuthType) String() string {
  47. return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
  48. }
  49. func (AuthType) Descriptor() protoreflect.EnumDescriptor {
  50. return file_proxy_socks_config_proto_enumTypes[0].Descriptor()
  51. }
  52. func (AuthType) Type() protoreflect.EnumType {
  53. return &file_proxy_socks_config_proto_enumTypes[0]
  54. }
  55. func (x AuthType) Number() protoreflect.EnumNumber {
  56. return protoreflect.EnumNumber(x)
  57. }
  58. // Deprecated: Use AuthType.Descriptor instead.
  59. func (AuthType) EnumDescriptor() ([]byte, []int) {
  60. return file_proxy_socks_config_proto_rawDescGZIP(), []int{0}
  61. }
  62. // Account represents a Socks account.
  63. type Account struct {
  64. state protoimpl.MessageState `protogen:"open.v1"`
  65. Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
  66. Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
  67. unknownFields protoimpl.UnknownFields
  68. sizeCache protoimpl.SizeCache
  69. }
  70. func (x *Account) Reset() {
  71. *x = Account{}
  72. mi := &file_proxy_socks_config_proto_msgTypes[0]
  73. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  74. ms.StoreMessageInfo(mi)
  75. }
  76. func (x *Account) String() string {
  77. return protoimpl.X.MessageStringOf(x)
  78. }
  79. func (*Account) ProtoMessage() {}
  80. func (x *Account) ProtoReflect() protoreflect.Message {
  81. mi := &file_proxy_socks_config_proto_msgTypes[0]
  82. if x != nil {
  83. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  84. if ms.LoadMessageInfo() == nil {
  85. ms.StoreMessageInfo(mi)
  86. }
  87. return ms
  88. }
  89. return mi.MessageOf(x)
  90. }
  91. // Deprecated: Use Account.ProtoReflect.Descriptor instead.
  92. func (*Account) Descriptor() ([]byte, []int) {
  93. return file_proxy_socks_config_proto_rawDescGZIP(), []int{0}
  94. }
  95. func (x *Account) GetUsername() string {
  96. if x != nil {
  97. return x.Username
  98. }
  99. return ""
  100. }
  101. func (x *Account) GetPassword() string {
  102. if x != nil {
  103. return x.Password
  104. }
  105. return ""
  106. }
  107. // ServerConfig is the protobuf config for Socks server.
  108. type ServerConfig struct {
  109. state protoimpl.MessageState `protogen:"open.v1"`
  110. AuthType AuthType `protobuf:"varint,1,opt,name=auth_type,json=authType,proto3,enum=xray.proxy.socks.AuthType" json:"auth_type,omitempty"`
  111. Accounts map[string]string `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
  112. Address *net.IPOrDomain `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"`
  113. UdpEnabled bool `protobuf:"varint,4,opt,name=udp_enabled,json=udpEnabled,proto3" json:"udp_enabled,omitempty"`
  114. UserLevel uint32 `protobuf:"varint,6,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"`
  115. unknownFields protoimpl.UnknownFields
  116. sizeCache protoimpl.SizeCache
  117. }
  118. func (x *ServerConfig) Reset() {
  119. *x = ServerConfig{}
  120. mi := &file_proxy_socks_config_proto_msgTypes[1]
  121. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  122. ms.StoreMessageInfo(mi)
  123. }
  124. func (x *ServerConfig) String() string {
  125. return protoimpl.X.MessageStringOf(x)
  126. }
  127. func (*ServerConfig) ProtoMessage() {}
  128. func (x *ServerConfig) ProtoReflect() protoreflect.Message {
  129. mi := &file_proxy_socks_config_proto_msgTypes[1]
  130. if x != nil {
  131. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  132. if ms.LoadMessageInfo() == nil {
  133. ms.StoreMessageInfo(mi)
  134. }
  135. return ms
  136. }
  137. return mi.MessageOf(x)
  138. }
  139. // Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead.
  140. func (*ServerConfig) Descriptor() ([]byte, []int) {
  141. return file_proxy_socks_config_proto_rawDescGZIP(), []int{1}
  142. }
  143. func (x *ServerConfig) GetAuthType() AuthType {
  144. if x != nil {
  145. return x.AuthType
  146. }
  147. return AuthType_NO_AUTH
  148. }
  149. func (x *ServerConfig) GetAccounts() map[string]string {
  150. if x != nil {
  151. return x.Accounts
  152. }
  153. return nil
  154. }
  155. func (x *ServerConfig) GetAddress() *net.IPOrDomain {
  156. if x != nil {
  157. return x.Address
  158. }
  159. return nil
  160. }
  161. func (x *ServerConfig) GetUdpEnabled() bool {
  162. if x != nil {
  163. return x.UdpEnabled
  164. }
  165. return false
  166. }
  167. func (x *ServerConfig) GetUserLevel() uint32 {
  168. if x != nil {
  169. return x.UserLevel
  170. }
  171. return 0
  172. }
  173. // ClientConfig is the protobuf config for Socks client.
  174. type ClientConfig struct {
  175. state protoimpl.MessageState `protogen:"open.v1"`
  176. // Sever is a list of Socks server addresses.
  177. Server *protocol.ServerEndpoint `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"`
  178. unknownFields protoimpl.UnknownFields
  179. sizeCache protoimpl.SizeCache
  180. }
  181. func (x *ClientConfig) Reset() {
  182. *x = ClientConfig{}
  183. mi := &file_proxy_socks_config_proto_msgTypes[2]
  184. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  185. ms.StoreMessageInfo(mi)
  186. }
  187. func (x *ClientConfig) String() string {
  188. return protoimpl.X.MessageStringOf(x)
  189. }
  190. func (*ClientConfig) ProtoMessage() {}
  191. func (x *ClientConfig) ProtoReflect() protoreflect.Message {
  192. mi := &file_proxy_socks_config_proto_msgTypes[2]
  193. if x != nil {
  194. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  195. if ms.LoadMessageInfo() == nil {
  196. ms.StoreMessageInfo(mi)
  197. }
  198. return ms
  199. }
  200. return mi.MessageOf(x)
  201. }
  202. // Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead.
  203. func (*ClientConfig) Descriptor() ([]byte, []int) {
  204. return file_proxy_socks_config_proto_rawDescGZIP(), []int{2}
  205. }
  206. func (x *ClientConfig) GetServer() *protocol.ServerEndpoint {
  207. if x != nil {
  208. return x.Server
  209. }
  210. return nil
  211. }
  212. var File_proxy_socks_config_proto protoreflect.FileDescriptor
  213. const file_proxy_socks_config_proto_rawDesc = "" +
  214. "\n" +
  215. "\x18proxy/socks/config.proto\x12\x10xray.proxy.socks\x1a\x18common/net/address.proto\x1a!common/protocol/server_spec.proto\"A\n" +
  216. "\aAccount\x12\x1a\n" +
  217. "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" +
  218. "\bpassword\x18\x02 \x01(\tR\bpassword\"\xc5\x02\n" +
  219. "\fServerConfig\x127\n" +
  220. "\tauth_type\x18\x01 \x01(\x0e2\x1a.xray.proxy.socks.AuthTypeR\bauthType\x12H\n" +
  221. "\baccounts\x18\x02 \x03(\v2,.xray.proxy.socks.ServerConfig.AccountsEntryR\baccounts\x125\n" +
  222. "\aaddress\x18\x03 \x01(\v2\x1b.xray.common.net.IPOrDomainR\aaddress\x12\x1f\n" +
  223. "\vudp_enabled\x18\x04 \x01(\bR\n" +
  224. "udpEnabled\x12\x1d\n" +
  225. "\n" +
  226. "user_level\x18\x06 \x01(\rR\tuserLevel\x1a;\n" +
  227. "\rAccountsEntry\x12\x10\n" +
  228. "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
  229. "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"L\n" +
  230. "\fClientConfig\x12<\n" +
  231. "\x06server\x18\x01 \x01(\v2$.xray.common.protocol.ServerEndpointR\x06server*%\n" +
  232. "\bAuthType\x12\v\n" +
  233. "\aNO_AUTH\x10\x00\x12\f\n" +
  234. "\bPASSWORD\x10\x01BR\n" +
  235. "\x14com.xray.proxy.socksP\x01Z%github.com/xtls/xray-core/proxy/socks\xaa\x02\x10Xray.Proxy.Socksb\x06proto3"
  236. var (
  237. file_proxy_socks_config_proto_rawDescOnce sync.Once
  238. file_proxy_socks_config_proto_rawDescData []byte
  239. )
  240. func file_proxy_socks_config_proto_rawDescGZIP() []byte {
  241. file_proxy_socks_config_proto_rawDescOnce.Do(func() {
  242. file_proxy_socks_config_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proxy_socks_config_proto_rawDesc), len(file_proxy_socks_config_proto_rawDesc)))
  243. })
  244. return file_proxy_socks_config_proto_rawDescData
  245. }
  246. var file_proxy_socks_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
  247. var file_proxy_socks_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
  248. var file_proxy_socks_config_proto_goTypes = []any{
  249. (AuthType)(0), // 0: xray.proxy.socks.AuthType
  250. (*Account)(nil), // 1: xray.proxy.socks.Account
  251. (*ServerConfig)(nil), // 2: xray.proxy.socks.ServerConfig
  252. (*ClientConfig)(nil), // 3: xray.proxy.socks.ClientConfig
  253. nil, // 4: xray.proxy.socks.ServerConfig.AccountsEntry
  254. (*net.IPOrDomain)(nil), // 5: xray.common.net.IPOrDomain
  255. (*protocol.ServerEndpoint)(nil), // 6: xray.common.protocol.ServerEndpoint
  256. }
  257. var file_proxy_socks_config_proto_depIdxs = []int32{
  258. 0, // 0: xray.proxy.socks.ServerConfig.auth_type:type_name -> xray.proxy.socks.AuthType
  259. 4, // 1: xray.proxy.socks.ServerConfig.accounts:type_name -> xray.proxy.socks.ServerConfig.AccountsEntry
  260. 5, // 2: xray.proxy.socks.ServerConfig.address:type_name -> xray.common.net.IPOrDomain
  261. 6, // 3: xray.proxy.socks.ClientConfig.server:type_name -> xray.common.protocol.ServerEndpoint
  262. 4, // [4:4] is the sub-list for method output_type
  263. 4, // [4:4] is the sub-list for method input_type
  264. 4, // [4:4] is the sub-list for extension type_name
  265. 4, // [4:4] is the sub-list for extension extendee
  266. 0, // [0:4] is the sub-list for field type_name
  267. }
  268. func init() { file_proxy_socks_config_proto_init() }
  269. func file_proxy_socks_config_proto_init() {
  270. if File_proxy_socks_config_proto != nil {
  271. return
  272. }
  273. type x struct{}
  274. out := protoimpl.TypeBuilder{
  275. File: protoimpl.DescBuilder{
  276. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  277. RawDescriptor: unsafe.Slice(unsafe.StringData(file_proxy_socks_config_proto_rawDesc), len(file_proxy_socks_config_proto_rawDesc)),
  278. NumEnums: 1,
  279. NumMessages: 4,
  280. NumExtensions: 0,
  281. NumServices: 0,
  282. },
  283. GoTypes: file_proxy_socks_config_proto_goTypes,
  284. DependencyIndexes: file_proxy_socks_config_proto_depIdxs,
  285. EnumInfos: file_proxy_socks_config_proto_enumTypes,
  286. MessageInfos: file_proxy_socks_config_proto_msgTypes,
  287. }.Build()
  288. File_proxy_socks_config_proto = out.File
  289. file_proxy_socks_config_proto_goTypes = nil
  290. file_proxy_socks_config_proto_depIdxs = nil
  291. }