I would ask if you are following some working example somewhere. I just did a quick search and no JS example I saw monitored for an ‘upgrade’ message. Not saying it isn’t there or can’t be used just that maybe it is handled differently with NodeJs or that particular library. I’d be shocked to learn there wasn’t an example on the Internet using that exact library.
I’d try copying something from an article that demonstrated it connected and that hello world worked.
I don’t know the answer either but I note that example is over 7 years old. There may be more effective ways of doing it since then… I don’t use Express but I have to believe you could find a working example of a project rather than a message.
I will probably put something together but it won’t be likely be this week and I will no doubt use the Hapi server which I like a lot. It is nice to use libraries that still have support and active development.
Again I’m not recommending one thing over another just suggesting that you may need to look around for slightly newer or more comprehensive examples.
oh this article is from 2020 Websocket Server in Node.js - Mastering JS but it uses a library named ws. You might consider giving it a try as they demonstrate it working with Express.