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

[WebSocket] SYNTAX_ERR: invalid url: wss://... #14

Closed
AlexanderWillner opened this issue May 23, 2011 · 6 comments
Closed

[WebSocket] SYNTAX_ERR: invalid url: wss://... #14

AlexanderWillner opened this issue May 23, 2011 · 6 comments
Labels

Comments

@AlexanderWillner
Copy link

Might be related with #11 or an invalid server certificate. When opening a new/existing pad I receive the following error messages in the browser log and the GUI does not respond (Safari 5. and Chrome 13 are working fine):

Firefox 5:

[WebSocket] SYNTAX_ERR: invalid url: wss://proxy:/socket.io/flashsocket
console.error(decodeURIComponent(message));
socket.io.js (line 2190)
Error calling method on NPObject!
[Break On This Error] self.__id, url, protocols,...ll, proxyPort || 0, headers || null);
socket.io.js (line 1930)
Error calling method on NPObject!
[Break On This Error] WebSocket.__flash.close(this.__id);
socket.io.js (line 1969)

Opera 11.11:

[23. Mai 2011 23:35:12] JavaScript - https://proxy/p/ET1tpyJRS4
Unknown thread
[WebSocket] SYNTAX_ERR: invalid url: wss://proxy:/socket.io/flashsocket
[23. Mai 2011 23:35:16] JavaScript - https://proxy/p/ET1tpyJRS4
Timeout thread: delay 5000 ms
Uncaught exception: Error: Error in Actionscript. Use a try/catch block to find error.
Error thrown at line 1969, column 4 in () in https://proxy/socket.io/socket.io.js:
    WebSocket.__flash.close(this.__id);
called from line 794, column 21 in () in https://proxy/socket.io/socket.io.js:
    this.socket.close();
called from line 1613, column 4 in (soft) in https://proxy/socket.io/socket.io.js:
    this.transport.disconnect();
called from line 1569, column 12 in () in https://proxy/socket.io/socket.io.js:
    self.disconnect(true);
@AlexanderWillner
Copy link
Author

Ok, the issue is that "this.base.options.port" is empty:

node_modules/socket.io/support/socket.io-client/socket.io.js:819:    + ':' + this.base.options.port

When setting the port to 443 manually it works using Firefox and Opera*.

  • Unfortunately Opera only shows the Pad, GUI, Colors, etc. but doesn't seem to send status updates (no error found in any log)

@AlexanderWillner
Copy link
Author

And here is a quickfix:

--- orig/node_modules/socket.io/support/socket.io-client/socket.io.js   2011-05-23 22:38:54.000000000 +0200
+++ patched/node_modules/socket.io/support/socket.io-client/socket.io.js    2011-05-25 13:55:32.000000000 +0200
@@ -814,6 +814,9 @@ if (typeof window != 'undefined'){
    * @api private
    */
   WS.prototype.prepareUrl = function(){
+    /* Quick workaround for issue 14: */
+    if ('' == this.base.options.port)
+       this.base.options.port = this.base.options.secure ? '443' : '80'
     return (this.base.options.secure ? 'wss' : 'ws') 
     + '://' + this.base.host 
     + ':' + this.base.options.port

@hanspinckaers
Copy link
Contributor

You should submit that to the socket.io repository.

@AlexanderWillner
Copy link
Author

You might be right, although the "fix" is very ugly and doesn't solve the root cause. Anyway: socketio/socket.io#161 (hope this is the correct repository).

@Pita
Copy link
Contributor

Pita commented May 29, 2011

It might not like the way I'm initalizing socket.io https://github.com/Pita/etherpad-lite/blob/master/static/js/pad2.js#L63 - I will experiment tomorrow with that.

@Pita
Copy link
Contributor

Pita commented May 30, 2011

I think I solved that with this commit Pita/etherpad-lite@18ec4da

@Pita Pita closed this as completed May 30, 2011
pedrobmarin added a commit to pedrobmarin/etherpad-lite that referenced this issue Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants