Container Network
Section titled “Container Network”Configure, manage, and control the network proxy or traffic-blocking settings for a container. These endpoints allow you to read, update, start, and stop network interfaces associated with a specific container, including support for SOCKS5, HTTP, and HTTPS proxies as well as full traffic blocking.
GET /api/v1/containers/{id}/network
Section titled “GET /api/v1/containers/{id}/network”Get the current network configuration and status for a container.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Unique identifier of the container to retrieve network configuration for |
curl -X GET "https://api.hoody.com/api/v1/containers/507f1f77bcf86cd799439012/network" \ -H "Authorization: Bearer <token>"const result = await client.api.containers.getNetworkConfig({ id: "507f1f77bcf86cd799439012"});{ "statusCode": 200, "message": "Network configuration retrieved successfully", "data": { "container_id": "507f1f77bcf86cd799439012", "configured": true, "type": "socks5", "proxy": "socks5://user:pass@proxy.example.com:1080", "country": "US", "city": "New York", "region": "North America", "comment": "Production proxy configuration", "dns_servers": [ "1.1.1.1", "8.8.8.8" ], "status": "running", "configured_at": "2025-01-15T10:00:00.000Z", "last_status_check": "2025-01-15T20:00:00.000Z", "remote_status": { "is_running": true, "last_check": "2025-01-15T20:00:00.000Z", "bridge_details": { "bridge_name": "br-hoody-507f", "bridge_ip": "10.20.0.1", "gost_listener_ip": "10.20.0.2", "port": 1080 } } }}{ "statusCode": 400, "error": "Bad Request", "message": "Invalid container ID format"}{ "statusCode": 401, "error": "Unauthorized", "message": "Authentication required"}{ "statusCode": 403, "error": "Forbidden", "message": "Access denied to this container"}{ "statusCode": 404, "error": "Not Found", "message": "Container not found"}{ "statusCode": 500, "error": "Internal Server Error", "message": "Failed to retrieve network configuration"}PATCH /api/v1/containers/{id}/network
Section titled “PATCH /api/v1/containers/{id}/network”Configure or update the network proxy or blocking settings for a container.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Unique identifier of the container to configure network for |
Request Body
Section titled “Request Body”| Name | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Network configuration type — one of socks5, http, https, or block (for traffic blocking) |
proxy | string | No | Proxy server URL (required for non-block types, e.g., socks5://user:pass@proxy.example.com:1080) |
country | string | No | Optional country for geographical proxy selection |
city | string | No | Optional city for geographical proxy selection |
region | string | No | Optional region for geographical proxy selection |
comment | string | No | Optional comment describing the network configuration |
dns_servers | array | No | Custom DNS servers (max 4, defaults to ["1.1.1.1", "8.8.8.8"]) |
curl -X PATCH "https://api.hoody.com/api/v1/containers/507f1f77bcf86cd799439012/network" \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "type": "socks5", "proxy": "socks5://user:pass@proxy.example.com:1080", "country": "US", "city": "New York", "region": "North America", "comment": "Production proxy for US traffic", "dns_servers": ["1.1.1.1", "8.8.8.8"] }'const result = await client.api.containers.updateNetworkConfig({ id: "507f1f77bcf86cd799439012", data: { type: "socks5", proxy: "socks5://user:pass@proxy.example.com:1080", country: "US", city: "New York", region: "North America", comment: "Production proxy for US traffic", dns_servers: ["1.1.1.1", "8.8.8.8"] }});{ "statusCode": 200, "message": "Network configuration updated successfully", "data": { "container_id": "507f1f77bcf86cd799439012", "type": "socks5", "proxy": "socks5://user:pass@proxy.example.com:1080", "country": "US", "city": "New York", "region": "North America", "comment": "Production proxy for US traffic", "dns_servers": [ "1.1.1.1", "8.8.8.8" ], "status": "configured", "configured_at": "2025-01-15T21:00:00.000Z", "bridge_details": { "bridge_name": "br-hoody-507f", "bridge_ip": "10.20.0.1", "gost_listener_ip": "10.20.0.2", "port": 1080 } }}{ "statusCode": 400, "error": "Bad Request", "message": "Proxy URL required for non-block type"}{ "statusCode": 401, "error": "Unauthorized", "message": "Authentication required"}{ "statusCode": 403, "error": "Forbidden", "message": "Cannot configure network for this container"}{ "statusCode": 404, "error": "Not Found", "message": "Container not found"}{ "statusCode": 500, "error": "Internal Server Error", "message": "Failed to update network configuration"}DELETE /api/v1/containers/{id}/network
Section titled “DELETE /api/v1/containers/{id}/network”Remove the entire network proxy or blocking configuration for a container.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Unique identifier of the container to remove network configuration from |
curl -X DELETE "https://api.hoody.com/api/v1/containers/507f1f77bcf86cd799439012/network" \ -H "Authorization: Bearer <token>"const result = await client.api.containers.removeNetworkConfig({ id: "507f1f77bcf86cd799439012"});{ "statusCode": 200, "message": "Network configuration removed successfully"}{ "statusCode": 400, "error": "Bad Request", "message": "Invalid container ID format"}{ "statusCode": 401, "error": "Unauthorized", "message": "Authentication required"}{ "statusCode": 403, "error": "Forbidden", "message": "Cannot remove network configuration from this container"}{ "statusCode": 404, "error": "Not Found", "message": "Container or network configuration not found"}{ "statusCode": 500, "error": "Internal Server Error", "message": "Failed to remove network configuration"}POST /api/v1/containers/{id}/network/start
Section titled “POST /api/v1/containers/{id}/network/start”Start the network proxy or blocking service for a container.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Unique identifier of the container to start network for |
curl -X POST "https://api.hoody.com/api/v1/containers/507f1f77bcf86cd799439012/network/start" \ -H "Authorization: Bearer <token>"const result = await client.api.containers.startNetwork({ id: "507f1f77bcf86cd799439012"});{ "statusCode": 200, "message": "Network service started successfully", "data": { "container_id": "507f1f77bcf86cd799439012", "status": "running", "is_running": true, "last_check": "2025-01-15T21:05:00.000Z", "bridge_details": { "bridge_name": "br-hoody-507f", "bridge_ip": "10.20.0.1", "gost_listener_ip": "10.20.0.2", "port": 1080 } }}{ "statusCode": 400, "error": "Bad Request", "message": "Network not configured for this container"}{ "statusCode": 401, "error": "Unauthorized", "message": "Authentication required"}{ "statusCode": 403, "error": "Forbidden", "message": "Cannot start network for this container"}{ "statusCode": 404, "error": "Not Found", "message": "Container not found"}{ "statusCode": 500, "error": "Internal Server Error", "message": "Failed to start network service"}POST /api/v1/containers/{id}/network/stop
Section titled “POST /api/v1/containers/{id}/network/stop”Stop the network proxy or blocking service for a container.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Unique identifier of the container to stop network for |
curl -X POST "https://api.hoody.com/api/v1/containers/507f1f77bcf86cd799439012/network/stop" \ -H "Authorization: Bearer <token>"const result = await client.api.containers.stopNetwork({ id: "507f1f77bcf86cd799439012"});{ "statusCode": 200, "message": "Network service stopped successfully", "data": { "container_id": "507f1f77bcf86cd799439012", "status": "stopped", "is_running": false, "last_check": "2025-01-15T21:10:00.000Z", "bridge_details": { "bridge_name": "br-hoody-507f", "bridge_ip": "10.20.0.1", "gost_listener_ip": "10.20.0.2", "port": 1080 } }}{ "statusCode": 400, "error": "Bad Request", "message": "Network not configured for this container"}{ "statusCode": 401, "error": "Unauthorized", "message": "Authentication required"}{ "statusCode": 403, "error": "Forbidden", "message": "Cannot stop network for this container"}{ "statusCode": 404, "error": "Not Found", "message": "Container not found"}{ "statusCode": 500, "error": "Internal Server Error", "message": "Failed to stop network service"}