Skip to content
Open
Changes from all 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
12 changes: 12 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ if (!process.env.SMB_ADDRESS) {
Log().warn('SMB_ADDRESS environment variable not set, using defaults');
}

try {
const smbUrl = new URL(SMB_ADDRESS);
const localHosts = ['localhost', '127.0.0.1', '::1'];
if (smbUrl.protocol === 'http:' && !localHosts.includes(smbUrl.hostname)) {
Log().warn(
`SMB_ADDRESS uses plaintext http:// to a remote host (${smbUrl.hostname}); SDP/ICE data will be sent unencrypted. Use https:// in production.`
);
}
} catch (err) {
Log().warn(`SMB_ADDRESS could not be parsed as a URL: ${SMB_ADDRESS}`);
}

const ENDPOINT_IDLE_TIMEOUT_S: string =
process.env.ENDPOINT_IDLE_TIMEOUT_S ?? '60';

Expand Down
Loading