4
votes

I have neo4j community server edition 3.4.5 and which will be giving me "WebSocket connection to 'ws://localhost:7687/' failed".

I found some solution to work in firefox, chrome, IE but those are temporary solutions which work. but I don't think that just by passing proxy would be a permanent solution.

It is not working if connected to VPN(office network), otherwise working. What could be a reason for this error within an office network? How to resolve this issue.

Any idea or suggestions, Please

2
If this were my question I would change the tags. While the application is Neo4j, it appears the problem is with VPN and I see no tags related to a communication protocol or such other than bolt which will only draw in the Neo4j people. The VPN people are the people that need to be looking at this question. - Guy Coder
Good Idea, Thanks. - user2848031

2 Answers

1
votes

There can be several reasons for this issue and I probably need to know more about your setup before I can pin point the problem.

1 check:
Disconnect from the VPN, and open a command prompt (Windows+R then write cmd and press enter) Use either telnet or putty ( https://www.putty.org/ ) and connect to 127.0.0.1 port 7687:

telnet 127.0.0.1 7687

See if you a response like this:

GET / HTTP/1.0

2 check:
Go to you proxy settings and see if you have a proxy enabled:
Firefox: Preferences/Options > Advanced > Network > Settings
IE: Tools > Options > Connections > Lan Settings

Suggest to turn off your proxy and do the check in check 1 again.

3 check:
Connect to your VPN and do the check 1 part once again

Check for error messages (that you probably would get) and then write in the command prompt:

route print

It should show a line like this:

    127.0.0.0        255.0.0.0               On-link         127.0.0.1    xxx
    127.0.0.1        255.255.255.255         On-link         127.0.0.1    xxx
    127.255.255.255  255.255.255.255         On-link         127.0.0.1    xxx

This ensure that you still have your loop back up and running (probably is ok).

4 check:
Turn off your local firewall with VPN connected (if allowed) and try the check 1 again.

Some firewall rules change connections to "localhost" while connected to a VPN, since the new connection is "corporate" or "public".

If that worked, you need to create a rule in your firewall to allow connection to port 7687 for all addresses, this will fix your problem.

5 check:
Check your neo4j community server to listen to "127.0.0.1" and not "0.0.0.0"

Check your ports open by using netstat

netstat -a -o

It should state something like this

  Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:7687            machinename:0          LISTENING       xxxx

or

  TCP    127.0.0.1:7687          machinename:0          LISTENING       xxxx

If the server is like the first line, it might be handled by a corporate firewall, but by using the 127.0.0.1 as address it should always be local.

Hopefully that will get you on the way :)

1
votes

i had same problem, so Let me tell you what i came out with...

the company has a proxy server for all connections, so i change my request from IP to DNS by typing nslookup IP on command prompt terminal.

from: ws://180......:80/socket/test to: ws://mxjuppro22......:80/socket/test

then error gone and now is working like a charm!!!

hope it helps