Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions public/__redirects
Original file line number Diff line number Diff line change
Expand Up @@ -2142,6 +2142,7 @@
/cloudflare-one/policies/filtering/enforce-sessions/ /cloudflare-one/connections/connect-devices/warp/configure-warp/warp-sessions/ 301
/cloudflare-one/policies/zero-trust/policy-management/ /cloudflare-one/policies/access/policy-management/ 301
/cloudflare-one/policies/filtering/dns-policies-builder/ /cloudflare-one/policies/gateway/dns-policies/ 301
/cloudflare-one/policies/gateway/http-policies/websocket/ /cloudflare-one/policies/gateway/http-policies/common-policies/#filter-websocket-traffic 301
/cloudflare-one/cloudflare-teams-roles-permissions/ /cloudflare-one/roles-permissions/ 301
/cloudflare-one/technical-limitations/ /cloudflare-one/account-limits/ 301
/support/traffic/argo-tunnel/ /cloudflare-one/connections/connect-networks/ 301
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,37 @@ curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
```

</TabItem> </Tabs>

## Filter WebSocket traffic

Gateway does not inspect or log [WebSocket](https://datatracker.ietf.org/doc/html/rfc6455) traffic. Instead, Gateway will only log the HTTP details used to make the WebSocket connection, as well as [network session information](/logs/reference/log-fields/account/zero_trust_network_sessions/). To filter your WebSocket traffic, create a policy with the `101` HTTP response code.

<Tabs syncKey="dashPlusAPI"> <TabItem label="Dashboard">

| Selector | Operator | Value | Action |
| ------------- | -------- | ------------------------- | ------ |
| HTTP Response | is | _101 SWITCHING_PROTOCOLS_ | Allow |

</TabItem>

<TabItem label="API">

```bash
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--data '{
"name": "Filter WebSocket",
"description": "Filter WebSocket traffic with HTTP code 101",
"enabled": true,
"action": "allow",
"filters": [
"http"
],
"traffic": "http.response.status_code == 101",
"identity": "",
"device_posture": ""
}'
```

</TabItem> </Tabs>

This file was deleted.