2021-05-26 11:05:53 +00:00
# HTTP
2023-06-14 14:17:07 +00:00
HTTP protocol.
2021-05-26 11:05:53 +00:00
::: warning
2023-06-14 14:17:07 +00:00
**The HTTP protocol does not provide encryption for transmission and is not suitable for transmission over public networks, as it can easily be used as a target for attacks.**
2021-05-26 11:05:53 +00:00
:::
2023-06-14 14:17:07 +00:00
The more meaningful use of `http` inbound is to listen in a local network or on the local machine to provide local services for other programs.
2021-05-26 11:05:53 +00:00
::: tip TIP 1
2023-06-14 14:17:07 +00:00
`http proxy` can only proxy the TCP protocol and cannot handle protocols based on UDP.
2021-05-26 11:05:53 +00:00
:::
::: tip TIP 2
2023-06-14 14:17:07 +00:00
In Linux, you can use the following environment variables to enable global HTTP proxy for the current session (many software support this setting, but some may not).
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
- `export http_proxy=http://127.0.0.1:8080/` (Change the address to the configured inbound HTTP proxy address)
2021-05-26 11:05:53 +00:00
- `export https_proxy=$http_proxy`
2023-06-14 14:17:07 +00:00
- :::
2021-05-26 11:05:53 +00:00
## InboundConfigurationObject
```json
{
"timeout": 0,
"accounts": [
{
"user": "my-username",
"pass": "my-password"
}
],
"allowTransparent": false,
"userLevel": 0
}
```
> `timeout`: number
2023-06-14 14:17:07 +00:00
The idle timeout in seconds. The default value is `300` , and 0 means no timeout.
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
When handling a connection, if no data is transmitted within the timeout period, the connection will be terminated.
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. The default value is an empty array.
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
When `accounts` is not empty, the HTTP proxy will perform Basic Authentication verification for inbound connections.
2021-05-26 11:05:53 +00:00
> `allowTransparent`: true | false
2023-06-14 14:17:07 +00:00
When set to `true` , it will forward all HTTP requests instead of just proxy requests.
2021-05-26 11:05:53 +00:00
::: tip
2023-06-14 14:17:07 +00:00
Enabling this option without proper configuration may cause an infinite loop.
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. It is a string and is required.
2021-05-26 11:05:53 +00:00
> `pass`: string
2023-06-14 14:17:07 +00:00
The password. It is a string and is required.