You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ./routes/index.jsimportfastifyPluginfrom'fastify-plugin';constrouter=asyncfastify=>{fastify.get('/',{websocket: true},(socket,req)=>{socket.on('message',message=>{socket.send('hi from server');});});};exportdefaultfastifyPlugin(router);
I used the link ws://localhost:3000/restaurant in the test software to not link to the server normally,
But successfully linked to the server with ws://localhost:3000/
Link to code that reproduces the bug
No response
Expected Behavior
Make the link adhere to the route prefix, access the websocket through ws://localhost:3000/restaurant
The text was updated successfully, but these errors were encountered:
Prerequisites
Fastify version
4.27.0
Plugin version
10.0.1
Node.js version
20.13.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
Windows 11 22631.3593
Description
I noticed #97 and #98 , but they didn't solve the problem I encountered!
I used the routing module in the server, imported routes from other files, and used route prefixes
Contents in './routes/index.js':
I used the link
ws://localhost:3000/restaurant
in the test software to not link to the server normally,But successfully linked to the server with
ws://localhost:3000/
Link to code that reproduces the bug
No response
Expected Behavior
Make the link adhere to the route prefix, access the websocket through
ws://localhost:3000/restaurant
The text was updated successfully, but these errors were encountered: