Cannot host WebSocket Server - error during handshake - javascript

I want to try a WebSockets and I found this artcile on the internet Using WebSocket in .NET
I am sure that I did every step properly, I enabled WebSockets in IIS, I wrote all clases which are mention in article, I register HTTP Handler in web.config etc.. but when I want to try it I still get exception:
WebSocket connection to 'ws://localhost/CodeProjectWeb/WSHandler.ashx' failed: Error during WebSocket handshake: Unexpected response code: 404
I know that 404 probably means that URL is wrong, but how can be wrong? Some additional info: I am running on windows 10, IIS 10.0 Express, .NET 4.6, Visual Studio 2013, I tried it on Google Chrome, Firefox (both last versions).
To be honest, this is not first tutorial which I tried. I already tried antoher 3-4 articles about WebSocket in .NET, also I tried use SignalR but still with the same results. I just dont know, I think that I am missing some important little thing..
If you need some more information just ask but I hope I write everything

I finally figure it out (probably). I have to turn off Windows Firewall to make it work. So if you have similar problem just be sure that your Firewall is turn off.

Related

JavaScript/Firefox: "Failed to register/update ServiceWorker", when nothing called ServiceWorker is in use

Here's a weird one.
I'm developing a Django/Bootstrap 3 web application, and recently I've started receiving this error in the JavaScript console:
Failed to register/update a ServiceWorker for scope ‘http://localhost:8000/’: Load failed with status 404 for script ‘http://localhost:8000/service-worker.js’
The funny thing is that I'm not actually attempting to use anything called ServiceWorker or service-worker.js and never have. I don't know what it's supposed to do. I do develop many other websites on localhost:8000 though, so I'm guessing it's some kind of left-overs from a different project.
The error does NOT show up when I try browsing in private mode, further implying that this is some kind of browser memory.
Still, I've reloaded with Ctrl-Shift-R and Shift-F5, and cleared all cookies for localhost. I've searched both my own code, as well as the entire Python environment for the strings service-worker.js and ServiceWorker but found nothing.
I'd really appreciate help with two things:
Learn what can cause this sort of thing.
Get rid of the error itself.
I'm using Firefox 64, Django 2.0.10 (with Django Debug Toolbar 1.9.1) with Bootstrap 3.3.7 on Ubuntu 18.04.
(Not even sure how to tag this thing, because I don't know what I'm dealing with.)
Type about:debugging#workers in Firefox bar. Find Service Worker for localhost and click unregister. It should helps if it is really leftover.
What it is?
Here, you can read about Service Workers, it has nothing to do with django or bootstrap. As far as I know, Bootstrap doesn't have service workers.

Why do i get a "404 not found" error on IE(not Chrome) in node.js express? and how to solve?

I'm making web server with node.js and express module.
So, I installed node.js, express and express-generator.
And I completed a prototype web server for my project yesterday.
But, when I tested my prototype, I have a strong question.
In Chrome, I could connect for URL like '127.0.0.1:3000'
or '172.30.5.164:3000'(this is my intranet ip address).
But!!
In Explorer, I could't connect!!
So, I tried to find the way.
I solved the 127.0.0.1:3000 problem.
Just I changed Explorer configuration for intranet and I could connect
like this way 'http://localhost:3000'
However,
I didn't find the way how to connect use URL like http://172.30.5.164:3000
I don't use socket.io module, just use basic express-generator template like GET/POST way.
I need how to connect on IE strongly because my project is related to OLE Automation, So I have to use ActiveXObject.
Anyone who give me the hint?
I'm not good at english writing, so i got to worry about that you understand my problem.
Thanks in advance.
There is a strange way IE handles local ip
see article.

PhantomJS 408 error "Socket operation timed out"

I'm getting this error when trying to open a webpage that is on the same server as the PhantomJS code. PhantomJS can open any other webpage (ssl or not) but won't open any webpage that is on my server. I always get this error and there is very little information, actually none, what "Socket operation timed out" means for PhantomJS.
I'm running CentOS 6.6 and PhantomJS 1.9.8. I tried a few PhantomJS versions already, including the latest 2.1.1 and I'm getting the same error.
The dev version of my app runs perfectly on Ubuntu 14.04 but doesn't seem to work on my production server.
I did have some luck opening webpages on this server working from another server (remote access, essentially).
Is there anything on my server (that is just running Wordpress) that can be blocking PhantomJS? The only thing I can think of is the fact I have SSL installed, but non-SSL pages also don't work.
I've tried command line and both php-phantomjs and wkhtmlpdf and always get a 408 error, unless I try another webpage that has a different IP address (google etc).
Any clue on what might be the problem?
In my case i try to get page as picture with phantomjs on same machine. I put 127.0.0.1 mysite.app in /etc/hosts. I am running laravel homestead.
I try all possible combination of options with 1.9, at the end I have realised that there is something wrong with version 1.9, because when I have switched to version 2.1.1 status 408 gone and everything forks fine.
Try changing the default user agent used by PhantomJS

How do I troubleshoot "GET https://cdn.sublimevideo.net/js/a94k1e4g.js net::ERR_SSL_PROTOCOL_ERROR"?

Hello I am fairly new to troubleshooting SSL errors, but have spent over an hour searching on this already with no luck. I'm using my personal MacBook Pro at work for iOS and OSX testing on a secured wifi connection, but whenever I try to test a dev page that uses sublimevideo player the page errs out & these errors described below continue to elude me. I just don't know where to begin. I tried looking for bad certificates or related certificates in my keychain but I only saw Apple related certs there. Clearing my cache and resetting the browser did not help, nor did turning off all extensions. Google has not been much help either unfortunately.
I have Charles installed but I don't see anything that jumps out at me when I do a test reload with it open...
UPDATE: I tried to load the file in a new browser window and it didn't even load there. I've tried loading the domain to see if I would get any kind of response and I did not. There is a less secure guest wifi, which I tried loading the js file on also, and it did so just fine so I'm doubtful it's anything on my own computer. I am starting to think this is a firewall blocking all connections with a white-list of sorts, but that is just my best guess.
What are some ways I can find the source of the problem?
Chrome:
>GET https://cdn.sublimevideo.net/is/a94k1e4g.js net::ERR_SSL_PROTOCOL_ERROR sublime_video_widget.js:63
>GET https://cdn.sublimevideo.net/is/a94k1e4g.js net::ERR_SSL_PROTOCOL_ERROR sublime_video_widget.js:63
>Uncaught ReferenceError: sublime is not defined sublime_video_widget.js:194
Safari:
ReferenceError: Can’t find variable: sublime
Failed to load resource: An SSL error has occurred and a secure connection to the server cannot be made. https://cdn.sublimevideo.net/js/a94k1e4g.js
Failed to load resource: There was a problem communicating with the secure web proxy server (HTTPS). https://cdn.sublimevideo.net/js/a94k1e4g.js
Mobile Safari:
Failed to load resource: An SSL error has occurred and a secure connection to the server cannot be made. https://cdn.sublimevideo.net/js/a94k1e4g.js
Failed to load resource: There was a problem communicating with the secure web proxy server (HTTPS). https://cdn.sublimevideo.net/js/a94k1e4g.js
ReferenceError: Can’t find variable: sublime sublime_video_widget.js:63

Unexpected response code 426

I am using Tomcat websockets and it is working fine in all browsers except in Safari where it is throwing Unexpected response code 426 error.
I went through web inspector and tried to google it to find solution to this issue.
But did not find any solution to it.
I am using Safari 5.1.7. Any help would be greatly appreciated.
Thanks in Advance
The 426 response code on upgrade is appropriate for when your websocket client is not conforming to the WebSocket standard RFC-6455.
See Section 4.2.2. Sending the Server's Opening Handshake.
https://www.rfc-editor.org/rfc/rfc6455#section-4.2.2
/version/
The |Sec-WebSocket-Version| header field in the client's
handshake includes the version of the WebSocket Protocol with
which the client is attempting to communicate. If this
version does not match a version understood by the server, the
server MUST abort the WebSocket handshake described in this
section and instead send an appropriate HTTP error code (such
as 426 Upgrade Required) and a |Sec-WebSocket-Version| header
field indicating the version(s) the server is capable of
understanding.
What is going on, is that Safari 5.x isn't using the final WebSocket spec, but rather an early experimental draft version, something that tomcat does not correctly support. Few production servers do anymore.
For more information see What browsers support HTML5 WebSocket API? and http://caniuse.com/websockets

Categories

Resources