little-brother / cicada

Lightweight monitoring of network devices
GNU General Public License v2.0
25 stars 9 forks source link

Need Help - Console Log Error #7

Open wruffin1 opened 6 years ago

wruffin1 commented 6 years ago

DOMException: Failed to construct 'WebSocket': The URL 'ws://10.120.102.42:NaN' is invalid. at connect (http://10.120.102.42/node/NetworkMonitor/Public/events.js:14:13) at HTMLDocument. (http://10.120.102.42/node/NetworkMonitor/Public/events.js:49:2) at j (http://10.120.102.42/node/NetworkMonitor/Public/vendors/jquery-1.11.0.min.js:2:27136) at Object.fireWith [as resolveWith] (http://10.120.102.42/node/NetworkMonitor/Public/vendors/jquery-1.11.0.min.js:2:27949) at Function.ready (http://10.120.102.42/node/NetworkMonitor/Public/vendors/jquery-1.11.0.min.js:2:29783) at HTMLDocument.K (http://10.120.102.42/node/NetworkMonitor/Public/vendors/jquery-1.11.0.min.js:2:30128) connect @ events.js:16 (anonymous) @ events.js:49 j @ jquery-1.11.0.min.js:2 fireWith @ jquery-1.11.0.min.js:2 ready @ jquery-1.11.0.min.js:2 K @ jquery-1.11.0.min.js:2 jquery-1.11.0.min.js:4 GET http://10.120.102.42/device 404 (Not Found) send @ jquery-1.11.0.min.js:4 ajax @ jquery-1.11.0.min.js:4 (anonymous) @ app-device.js:26 j @ jquery-1.11.0.min.js:2 fireWith @ jquery-1.11.0.min.js:2 ready @ jquery-1.11.0.min.js:2 K @ jquery-1.11.0.min.js:2 jquery-1.11.0.min.js:4 GET http://10.120.102.42/diagram 404 (Not Found)

little-brother commented 6 years ago

Could you provide more details: browser name/version and OS?

To quick fix: edit /public/events.js line 14 socket = new WebSocket('ws://' + location.hostname + ':' + (parseInt(location.port) + 1)); to socket = new WebSocket('ws://' + location.hostname + ':' + 5001));

wruffin1 commented 6 years ago

Browser: Google Chrome Version 66.0.3359.139

OS : Windows 7

Application resides on a server running Windows Server 2012 " Also when try to run web application on my pc using my chrome I receive and Alert message: "Websocket disabled: Failed to construct 'WebSocket': The URL 'ws://10.120.102.42:NaN' is invalid."

William S Ruffin wruffin1@verizon.net

-----Original Message----- From: little-brother notifications@github.com To: little-brother/cicada cicada@noreply.github.com Cc: wruffin1 wruffin1@verizon.net; Author author@noreply.github.com Sent: Wed, May 2, 2018 12:07 pm Subject: Re: [little-brother/cicada] Need Help - Console Log Error (#7)

Could you provide more details: browser name/version and OS? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

wruffin1 commented 6 years ago

I modified events.js line 14 as you suggested, now i am receiving this console log error message repeatly:

WebSocket connection to 'ws://10.120.102.42:5001/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED connect @ events.js:14 (anonymous) @ events.js:49 j @ jquery-1.11.0.min.js:2 fireWith @ jquery-1.11.0.min.js:2 ready @ jquery-1.11.0.min.js:2 K @ jquery-1.11.0.min.js:2 events.js:36 Wed May 02 2018 14:18:11 GMT-0400 (Eastern Daylight Time): Notify server is disconnected.

little-brother commented 6 years ago

Check Windows firewall. Ensure that 5000 and 5001 ports is unblocked. Look at this tutor to get more details.

wruffin1 commented 6 years ago

THE PORTS ARE UNBLOCKED

I am now receiving theses errors

GET http://10.120.102.42/device 404 (Not Found) send @ jquery-1.11.0.min.js:4 ajax @ jquery-1.11.0.min.js:4 (anonymous) @ app-device.js:26 j @ jquery-1.11.0.min.js:2 fireWith @ jquery-1.11.0.min.js:2 ready @ jquery-1.11.0.min.js:2 K @ jquery-1.11.0.min.js:2 jquery-1.11.0.min.js:4 GET http://10.120.102.42/diagram 404 (Not Found) send @ jquery-1.11.0.min.js:4 ajax @ jquery-1.11.0.min.js:4 (anonymous) @ app-diagram.js:13 j @ jquery-1.11.0.min.js:2 fireWith @ jquery-1.11.0.min.js:2 ready @ jquery-1.11.0.min.js:2 K @ jquery-1.11.0.min.js:2 events.js:14 WebSocket connection to 'ws://10.120.102.42:5001/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED connect @ events.js:14 (anonymous) @ events.js:49 j @ jquery-1.11.0.min.js:2 fireWith @ jquery-1.11.0.min.js:2 ready @ jquery-1.11.0.min.js:2 K @ jquery-1.11.0.min.js:2 events.js:36 Wed May 02 2018 16:24:00 GMT-0400 (Eastern Daylight Time): Notify server is disconnected. events.js:14 WebSocket connection to 'ws://10.120.102.42:5001/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED connect @ events.js:14 events.js:36 Wed May 02 2018 16:24:03 GMT-0400 (Eastern Daylight Time): Notify server is disconnected. events.js:14 WebSocket connection to 'ws://10.120.102.42:5001/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED connect @ events.js:14 events.js:36 Wed May 02 2018 16:24:06 GMT-0400 (Eastern Daylight Time): Notify server is disconnected. events.js:14 WebSocket connection to 'ws://10.120.102.42:5001/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED connect @ events.js:14 events.js:36 Wed May 02 2018 16:24:09 GMT-0400 (Eastern Daylight Time): Notify server is disconnected. events.js:14 WebSocket connection to 'ws://10.120.102.42:5001/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED connect @ events.js:14 events.js:36 Wed May 02 2018 16:24:12 GMT-0400 (Eastern Daylight Time): Notify server is disconnected.

little-brother commented 6 years ago

http://10.120.102.42/device a some strange request. It must be http://10.120.102.42:5000/device

Could you check via Firefox or Edge? It's look like that Chrome ignores location.port. I also use Win7/Chrome but don't have any problem with connection.

wruffin1 commented 6 years ago

Need Help - I have it installed on my server and it works fine using any browser on my server adding 127.0.0.1:5000 in my address field. When i try to access the application from a client browser it fails can't find /device and /diagram both have an error of 404

little-brother commented 6 years ago

Check ports again. On client machine run telnet 10.120.102.42 5000 and telnet 10.120.102.42 5001. If the port is closed, a warning will be displayed. Here more details.

wruffin1 commented 6 years ago

Got it, that works great. How do you access the port from http when you have no access to the command prompt on the server ?

Sent from my iPhone

On May 8, 2018, at 6:26 PM, little-brother notifications@github.com wrote:

Check ports again. On client machine run telnet 10.120.102.42 5000 and telnet 10.120.102.42 5000. If the port is closed, a warning will be displayed. Here more details.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

little-brother commented 6 years ago

These commands only check the ports, and do not access it. From mobile devices, you can check open ports using special programs.