For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/static_analysis/static_analysis_rules/javascript-browser-security/insecure-websocket.md. A documentation index is available at /llms.txt.
This product is not supported for your selected Datadog site. ().

Metadata

ID: javascript-browser-security/insecure-websocket

Language: JavaScript

Severity: Warning

Category: Security

CWE: 319

Related CWEs:

Description

Always use secure websocket communication. When using websocket, use addresses that are SSL-enabled.

Non-Compliant Code Examples

const client = new WebSocket('ws://app.domain.tld')

Compliant Code Examples

const client = new WebSocket('wss://app.domain.tld')
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Security