Skip to content

Websocket issues #10

@adelevie

Description

@adelevie

Have any of you had issues with web sockets when deployed on cf?

I've been getting:

WebSocket connection to 'wss://iaa-mvp.18f.gov/sockjs/820/8st6qt8v/websocket' failed: Error during WebSocket handshake: Unexpected response code: 400

link

So I read on StackOverflow that I need to set the DDP_DEFAULT_CONNECTION_URL to use port 4443. I did that (DDP_DEFAULT_CONNECTION_URL: ddp+sockjs://iaa-mvp.18f.gov:4443/sockjs), and then I got a CORS error.

I added

WebApp.connectHandlers.use(function(req, res, next) {
  res.setHeader("Access-Control-Allow-Origin", "*");
  return next();
});

to the isServer block, but I'm still getting the same CORS error from before (from Chrome Dev Tools):

XMLHttpRequest cannot load https://iaa-mvp.18f.gov:4443/sockjs/info?cb=5kzx7yu53l. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://iaa-mvp.18f.gov' is therefore not allowed access.

Any help or guidance here would be great.

cc @dlapiduz @afeld

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions