mirror of
https://github.com/XTLS/Xray-docs-next.git
synced 2026-09-30 19:08:10 +03:00
46 lines
1.2 KiB
Markdown
46 lines
1.2 KiB
Markdown
# Blackhole
|
|
|
|
Blackhole is an outbound data protocol that blocks all outbound data. When used in conjunction with [Routing Configuration](../routing.md), it can achieve the effect of blocking access to certain websites.
|
|
|
|
## OutboundConfigurationObject
|
|
|
|
`OutboundConfigurationObject` corresponds to the `settings` item in [`OutboundObject`](../outbound.md).
|
|
|
|
```json
|
|
{
|
|
"outbounds": [
|
|
{
|
|
// ...
|
|
"protocol": "blackhole",
|
|
// [!code focus:5]
|
|
"settings": {
|
|
"response": {
|
|
"type": "none"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
> `response`: [ResponseObject](#responseobject)
|
|
|
|
Configures the response data of the Blackhole.
|
|
|
|
After receiving data to be forwarded, Blackhole will send the specified response data, then close the connection. The data to be forwarded will be discarded.
|
|
If this item is not specified, Blackhole will close the connection immediately.
|
|
|
|
### ResponseObject
|
|
|
|
```json
|
|
{
|
|
"type": "none"
|
|
}
|
|
```
|
|
|
|
> `type`: "http" | "none"
|
|
|
|
When `type` is `"none"` (default value), Blackhole will close the connection immediately.
|
|
|
|
When `type` is `"http"`, Blackhole will send back a simple HTTP 403 response packet, then close the connection.
|