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

wss Fails over SSL, works well on https #5347

Closed
grosscorporation opened this issue Feb 5, 2019 · 13 comments
Closed

wss Fails over SSL, works well on https #5347

grosscorporation opened this issue Feb 5, 2019 · 13 comments
Labels
type:question Support or code-level question

Comments

@grosscorporation
Copy link

grosscorporation commented Feb 5, 2019

Issue Description

I am trying to run ParseLiveQueries, and everything seems to work well over nodejs HTTP, but fails over HTTPS

Steps to reproduce

Expected Results

Actual Outcome

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 3.0
    • Operating System: 3.1.1
    • Hardware: Linux
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): [FILL THIS OUT]
  • Database

    • MongoDB version: 3.4
    • Storage engine: wiredTiger
    • Hardware: Linux
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): AWS, Localhost

Logs/Trace

info: Client disconnect: undefined
error: Can not find client undefined on disconnect

parse.js:1353 WebSocket connection to 'wss://localhost:8080/api/' failed: Error during WebSocket handshake: net::ERR_SSL_PROTOCOL_ERROR

@flovilmart
Copy link
Contributor

I will assume you are using nginx. Did you configure it correctly for web sockets?

Sent with GitHawk

@grosscorporation
Copy link
Author

grosscorporation commented Feb 6, 2019

OPINION: Its a "uws" module error on line ParseWebSocketServer.js line 14, and has since been fixed in "ws". "uws" module has been deprecated,

const getWS = function () {
  try {
    return require('uws'); 
  } catch (e) {
    return require('ws');
  }
};

my temporary solution:

const getWS =  require('ws');

What do you suggest?

@flovilmart
Copy link
Contributor

How does this relate to your issue description that states that all work well over node HTTPS and not HTTPS? (I’m not even sure what this means).

Sent with GitHawk

@grosscorporation
Copy link
Author

grosscorporation commented Feb 6, 2019

*** I meant to say HTTP and not HTTPS. two things are certain, "uws" don't exist no more, my issue is temporarily solved by its omission.

@flovilmart
Copy link
Contributor

And http va https has nothing to do with ws versus uws as packages.

Sent with GitHawk

@grosscorporation
Copy link
Author

grosscorporation commented Feb 6, 2019

Well according to you, thanks for nothing buddy. uws doesn't install as required by parse-server, because it doesn't exist

@flovilmart
Copy link
Contributor

not sure what this is then:

$ ls node_modules/uws
LICENSE                 uws_darwin_57.node*     uws_linux_59.node*      uws_win32_64.node*
README.md               uws_darwin_59.node*     uws_linux_64.node*
package.json            uws_darwin_64.node*     uws_win32_57.node*
uws.js                  uws_linux_57.node*      uws_win32_59.node*
~/src/Parse/parse-server (master ±)

And this:

npm ls uws
parse-server@3.1.3 /Users/florent/src/Parse/parse-server
└── uws@10.148.1

How is it not installed for you?

@grosscorporation
Copy link
Author

It installs but fails over wss:// works well with ws://

@stale
Copy link

stale bot commented Mar 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 23, 2019
@stale stale bot closed this as completed Mar 30, 2019
@dplewis
Copy link
Member

dplewis commented Mar 30, 2019

@GoGross out of curiosity. What version of Node are you running. uws only had binding to node 8 and 9. I believe.

@grosscorporation
Copy link
Author

I am running version 10

@thunderwin
Copy link

I have the same issue... how to solve it..

@grosscorporation
Copy link
Author

I don't know why they won't accept my PR but it's because npm uws is deprecated and instead of calling ws ParseWebSocketServer.js line 14 still tries it, try remove it completely or edit the module file :

const getWS = function () {
  try {
    return require('uws');
  } catch (e) {
    return require('ws');
  }
};

// my temporary solution:

const getWS =  require('ws');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

5 participants