2023-06-14 14:17:07 +00:00
# SOCKS
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
The standard SOCKS protocol implementation is compatible with [SOCKS 4 ](http://ftp.icm.edu.pl/packages/socks/socks4/SOCKS4.protocol ), SOCKS 4a, and [SOCKS 5 ](http://ftp.icm.edu.pl/packages/socks/socks4/SOCKS4.protocol ).
2021-05-26 11:05:53 +00:00
::: danger
2023-06-14 14:17:07 +00:00
The SOCKS protocol does not provide encryption for transport and is not suitable for transmitting data over public networks.
2021-05-26 11:05:53 +00:00
:::
2023-06-14 14:17:07 +00:00
The use of `SOCKS` inbound is more meaningful in a local area network or local environment, where it can be used to listen for incoming connections and provide local services to other programs.
2021-05-26 11:05:53 +00:00
## InboundConfigurationObject
```json
{
"auth": "noauth",
"accounts": [
{
"user": "my-username",
"pass": "my-password"
}
],
"udp": false,
"ip": "127.0.0.1",
"userLevel": 0
}
```
> `auth`: "noauth" | "password"
2023-06-14 14:17:07 +00:00
The authentication method for the SOCKS protocol, supporting `"noauth"` for anonymous mode and `"password"` for username/password authentication.
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
The default value is `"noauth"` .
2021-05-26 11:05:53 +00:00
> `accounts`: \[ [AccountObject](#accountobject) \]
2023-06-14 14:17:07 +00:00
An array where each element represents a user account.
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
This option is only valid when `auth` is set to `"password"` .
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
The default value is an empty array.
2021-05-26 11:05:53 +00:00
> `udp`: true | false
2023-06-14 14:17:07 +00:00
Whether to enable UDP protocol support.
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
The default value is `false` .
2021-05-26 11:05:53 +00:00
> `ip`: address
2023-06-14 14:17:07 +00:00
When UDP is enabled, Xray needs to know the local IP address.
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
The default value is `"127.0.0.1"` .
2021-05-26 11:05:53 +00:00
> `userLevel`: number
2023-06-14 14:17:07 +00:00
The user level that the connection will use to determine the corresponding [Local Policy ](../policy.md#levelpolicyobject ).
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
The value of `userLevel` corresponds to the value of `level` in the [policy ](../policy.md#policyobject ). If not specified, the default value is 0.
2021-05-26 11:05:53 +00:00
### AccountObject
```json
{
"user": "my-username",
"pass": "my-password"
}
```
> `user`: string
2023-06-14 14:17:07 +00:00
The username as a string. Required.
2021-05-26 11:05:53 +00:00
> `pass`: string
2023-06-14 14:17:07 +00:00
The password as a string. Required.