Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to support two websockets #1694

Open
adambezecny opened this issue Nov 20, 2019 · 1 comment
Open

how to support two websockets #1694

adambezecny opened this issue Nov 20, 2019 · 1 comment

Comments

@adambezecny
Copy link

we are configuring websocket for our feathersjs app in following way

const feathers = require('@feathersjs/feathers')
const expressFs = require('@feathersjs/express')
const socketiofs = require('@feathersjs/socketio')
const appFs = expressFs(feathers())

  appFs.configure(socketiofs({
    path: '/vapapi/channels/webchat/v1'
  }))

Then later in the code we are accessing the websocket like this:

this.ws = feathersjsApp.io

Is it possible to have secondary websocket with different path (existing in parallel with first one), i.e.

  appFs.configure(socketiofs({
    path: '/vapapi/channels/webchat/v2'
  }))

We still need to access underlying socket directly, something like

this.ws2 = feathersjsApp.io2????? (i know this will not work:) )

Please advise whether this is feasible and how to do it. We basically need to access websocket directly because we are wrapping it in redis adapter

@daffl
Copy link
Member

daffl commented Dec 10, 2019

Socket.io only allows to run one instance on a server. This Stackoverflow question recommends to use namespaces but I'd have to look how this would work with setting up different namespaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants