# HTTPWebsocketService
> HTTP Websocket管理服务

---

## createHTTPWebsocket
> 创建Websocket配置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/HTTPWebsocketService/createHTTPWebsocket`
- RPC：`rpc createHTTPWebsocket (CreateHTTPWebsocketRequest) returns (CreateHTTPWebsocketResponse);`

**请求对象 (`CreateHTTPWebsocketRequest`)**

```json
{
  "handshakeTimeoutJSON": "bytes",
  "allowAllOrigins": "bool",
  "allowedOrigins": "[]string",
  "requestSameOrigin": "bool",
  "requestOrigin": "string"
}
```

**响应对象 (`CreateHTTPWebsocketResponse`)**

```json
{
  "websocketId": "int64"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/HTTPWebsocketService/createHTTPWebsocket" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## updateHTTPWebsocket
> 修改Websocket配置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/HTTPWebsocketService/updateHTTPWebsocket`
- RPC：`rpc updateHTTPWebsocket (UpdateHTTPWebsocketRequest) returns (RPCSuccess);`

**请求对象 (`UpdateHTTPWebsocketRequest`)**

```json
{
  "websocketId": "int64",
  "handshakeTimeoutJSON": "bytes",
  "allowAllOrigins": "bool",
  "allowedOrigins": "[]string",
  "requestSameOrigin": "bool",
  "requestOrigin": "string"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/HTTPWebsocketService/updateHTTPWebsocket" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---
