# pusher-js: wss needs enabledTransports ['ws'] plus forceTLS, not 'wss' alone

## TL;DR

To force secure websockets in pusher-js, set both options together: const pusher = new Pusher(APP_KEY, { cluster: APP_CLUSTER, enabledTransports: ['ws'], forceTLS: true, }); Putting 'wss' alone in enabledTransports does not work; the library requires 'ws' in the list plus forceTLS: true to upgrade to wss. Note the reverse: if you add transports to the list later, ones not listed are disabled, so future new transports the library adds will not be used. Context: Docs (pusher-js README): when restricting transports via enabledTransports, secure websockets need two settings together.

Use this when you run into the situation in the title.

**When not to use this skill:** unrelated tasks. It covers only the procedure above.

## Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

## Details

Note the reverse: if you add transports to the list later, ones not listed are disabled, so future new transports the library adds will not be used.

Context: Docs (pusher-js README): when restricting transports via enabledTransports, secure websockets need two settings together. Listing only 'wss' in enabledTransports does not work; you must include 'ws' in enabledTransports AND set forceTLS: true. Example: new Pusher(APP_KEY, { cluster: APP_CLUSTER, enabledTransports: ['ws'], forceTLS: true }). Without both, the client cannot establish the wss connection and falls back or fails depending on the rest of the config.
