Firefox WebSockets - firefox

I've read somewhere that the trunk version of Firefox already had a WebSocket implementation. Nevertheless, I've just tried the 3.7a4pre without success. It still
gives me the old "WebSocket is not defined" error message. Am I confused with WebWorkers?
Using a flash-based WebSocket implementation is not an option.
Please advice.

According to bug 472529 a patch has not yet been applied to trunk.
WebSocket (both the API and the wire protocol) are still in draft, so we're a way off yet.
Using a flash-based WebSocket implementation is not an option.
I'm afraid a fallback (Flash, Java, XMLHttpRequest long-polling etc.) is your only option in Firefox for now. The only browser that currently has native WebSocket is Chrome.

WebSockets has been just landed on Firefox trunk.

WebSockets disabled in Opera and Firefox 4: http://hacks.mozilla.org/2010/12/websockets-disabled-in-firefox-4/

They are called MozWebSockets on Firefox since v4
Check out the Mozilla Websocket Reference

Since Firefox supports WebSockets not strictly to official standards it had prefix "Moz", so you have to check if WebSocket is existing object, if yes use it, if no check MozWebSocket, if yes, then use it.
Since Firefox 11, they do support WebSockets without prefix, so it is the same as in Chrome now.

Related

Coldfusion websocket security error [duplicate]

Can someone using CF10 confirm if CF10 supports secure websocket wss://?
http://blog.kaazing.com/2012/02/28/html5-websocket-security-is-strong/
I checked with Hemant. The answer is no, it is NOT supported now, but it is under progress to be added.
On the basis of there being not a single mention of "secure websocket" or "wss" in the CF10 docs (according to Google), and in all the blogging Ray Camden has done on the topic there is not a single mention of it either, and indeed the only relevant match on all of Google for "cf10 wss" is back to this very question, I would say "no".
But that would be rather an odd implementation omission, I think.
I just tried hacking this on the websocketChannel.js file where the URL is created (line 18)
var lURL="ws://"+(_7e0)+":"+_cf_websocket_port+"/cfusion"+"/cfusion";
tried to do this
var lURL= (location.protocol === "https:" ? "wss" : "ws") + "://"+(_7e0)+":"+_cf_websocket_port+"/cfusion"+"/cfusion";
But alas the wss:// connection would just never connect. BS I tell you .. pure BS!! The only issue really is with IE10 as it will not connect to an unsecured websocket channel initiated from a secure page.
No it is not supported yet. However, it is being considered for
ColdFusion Splendor.
https://twitter.com/rakshithn/status/352722362799624193

Does nativescript have http2 support?

I'd like to understand whether http2 is supported with the current http nativescript library?
I understand that nsurlsession for iOS supports http2 but I'm not sure how it works for Android. I do know that okhttp supports http2.
Is anybody using http2 with nativescript?
Thanks for your help.
Can you not just use https://www.npmjs.com/package/http2?
Disclaimer: I've never tried it yet myself in nativescript

Clear ssl client certificate state from javascript in firefox 33.0.2 (removed Proprietary window.crypto)

I'm looking for a way to clear the SSL client certificate cache in Firefox as a kind of "log out" functionality so that the server does not recognize me anymore via the client certificate the next time I connect to it. The solution from clear-ssl-client-certificate-state-from-javascript
if (window.crypto) window.crypto.logout();
does not work anymore in the current version of Firefox.
With firefox 33.0.2 the Proprietary window.crypto properties/functions are removed
How can I do this in the current Firefox version?
You can enable window.crypto by setting
dom.webcrypto.enabled = true
in about:config.
However there is no out of box replacement for FF 33.
It seems like Mozilla rolled it back in FF34, so it should be available there again.
EDIT:
There is an replacement:
http://www.w3.org/TR/WebCryptoAPI/
There is not an official solution for FF & Chrome. for a unofficial solution see: Web Crypto API — An Authentication of Data and People in SSL

Firefox Websocket security issue

We have a websocket server on port 8080 setup on a Linode box. Chrome and Opera work just fine. Firefox however complains that the operation is insecure.
"The operation is insecure: Code 18"
If I try to create a new WebSocket object in the web console before the page is loaded everything is fine. However, after the page loads something is screwy then I cannot create the object anymore. See the attached screenshot.
I have no idea what operation is insecure or even how to go about diagnosing this.
As you point out in another answer, https:// to ws:// is disallowed by default on firefox.
Going to firefox's about:config and toggling network.websocket.allowInsecureFromHTTPS will get rid of the SecurityError.
I fixed this. The app itself is under SSL but the websocket being accessed is not. Chrome and Opera don't care but Firefox does. According to:
https://bugzilla.mozilla.org/show_bug.cgi?id=303952
This is known and is not considered a bug. Mozilla's response: wontfix
Solution, put websocket server under SSL and use wss://
This is a hunch based off limited info, and I probably should put this into a comment, but I don't have enough reputation points to do that yet.
Looking at your log, it seems as if 24 seconds are passing from the receipt of [object Websocket] (time 17:46:36.683) until you get The connection to ws://.....(time 17:47:00:952) error message.The long delay leads me to believe that the server could be timing out and closing the websocket connection. Look at this answer for a potential solution.
Had the same problem and attempted to fix by changing network.websocket.allowInsecureFromHTTPS in about:config which did not work.
Ended up finding this post => Unhandled Rejection (SecurityError): The operation is insecure. On a fresh create-react-app project
Changing this in index.js ended up working for me
serviceWorker.register();
//serviceWorker.unregister();
Open "about:config" url in firefox. Search for allowInsecureFromHTTPS and set it to true
Beside secure ssl context and cross-origin policies, assigning some port can trigger the error as well.
What are valid http ports for Firefox? I don't know precisely, but have to be between 1500 and 64000, or the console will display:
SecurityError: The operation is insecure.
And http links will say:
This address is restricted
This address uses a network port which is normally used for purposes other than Web browsing.
Firefox has canceled the request for your protection.

WebWorkers and WebSockets with Firefox

I'm trying to implement a working WebSocket connection within a WebWorker. That should be simple and it is if I use Chrome as b rowser. However, since this experiment should further become part of a production I need it to work on all the great Browsers, namely also Firefox.
My problem is that I can't get it working with Firefox. At first Firefox wasn't able to create a WebWorker. That was a Bug and is fixed with version 9. But now it seems that it wouldn't be able to create a WebSocket within the Worker.
I tried the following line of code:
var ws = new WebSocket(url);
which fails with:
WebSocket is not defined
Well, according to this it should work. But it doesn't, neither within the WebWorker nor outside of this context. I tried the older
var ws = new MozWebSocket(url);
which seems to work outside of the WebWorker but I get the same error as above within it.
Now, what's the problem? I know WebSockets where disabled byy default in some older versions but version 9 should support a similar functionality as Chrome (at least that's what they say on their side). So am I doing something wrong?
Im using Ubuntu 11.10 and did not test other browsers yet.
Thanks in advance!
There's no support for WebSocket in workers in Firefox yet. See https://bugzilla.mozilla.org/show_bug.cgi?id=504553
Update: Firefox 35 added support.

Resources