Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Is it necessary to set `secure: true` when connecting to an https server?

$
0
0

I have a Nodejs backend that my frontend proxies to through Nginx, which is responsible for routing all traffic. I'm using Let's Encrypt, and the server can be accessed by going to it (https://example.com). I also have load balancing setup to route traffic upstream via the 'least connections' protocol.

On the frontend, I connect socket.io like this:

import { io, ManagerOptions, SocketOptions } from 'socket.io-client';const otherOpts = {};const socket = io('https://example.com', {    ...otherOpts,    secure: false,} as Partial<ManagerOptions & SocketOptions>);

This works as is, but in the current context, what would I need secure: true for? Is this the condition that determines ws vs wss? The client connects over https already, so is this something I can safely omit?


Viewing all articles
Browse latest Browse all 12111

Trending Articles