fastify / fastify-websocket

basic websocket support for fastify
MIT License
393 stars 72 forks source link

It's not working with WSS #224

Closed gorcer closed 1 year ago

gorcer commented 1 year ago

Prerequisites

Fastify version

4.5.3

Plugin version

4.3.0

Node.js version

v16.16.0

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

22.04

Description

When I try to connect to websocket via wss, I get a 404 error. The ws works fine.

Steps to Reproduce

My fastify routing:

module.exports = {
    method: 'GET',
    url: '/ws',
    exposeHeadRoute: false,
    websocket: true,
    handler: async function (connection , req) {
......
})
}

Expected Behavior

ws://mysite.com/api/ws -works fine wss://mysite.com/api/ws - returns 404 error

Please help.