Skip to content

Usage of websockets #27

@johanvdw

Description

@johanvdw

As this issue is closed:
#13

I wonder what's the correct method to use websockets.
Here is what I tried in my rollup.config.js:

     plugins: [
         !production && dev({
             extend: fp(async (server) => server.register(require("@fastify/websocket"))),
             basePath: '/live',
             dirs:['public'],
             onListen(server) { server.log.info('Hello world')},
             proxy: [{from: '/metadata/', to: 'http://localhost:5001/metadata/'},{from: '/temperature/', to: 'http://localhost:5001/temperature/', opts: { websocket: true}}]
         }
         ),

When trying to access the endpoint with a websocket (/temperature)
status code remains: '101 Switching Protocols'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions