0

I have the following code:

function connect() {
    var socket = new SockJS('/MyWebApp/wsdemo');
    stompClient = Stomp.over(socket);
    stompClient.connect({}, function(frame) {
        setConnected(true);
        stompClient.subscribe('/user/queue/greetings', function(greeting) {         
            displayQueueMessage(greeting);
        });
    });
}

From Machine A (local machine) Its works great , I receive the following console log when I connect (in chrome):

Opening Web Socket... stomp.js:130
Web Socket Opened... stomp.js:130
>>> CONNECT
accept-version:1.1,1.0
heart-beat:10000,10000

stomp.js:130
<<< PONG stomp.js:130
<<< CONNECTED
heart-beat:10000,10000
session:ID:Developer1-PC-56865-1406014918730-2:25
server:ActiveMQ/5.9.0
version:1.1

stomp.js:130
connected to server ActiveMQ/5.9.0 stomp.js:130
send PING every 10000ms stomp.js:130
check PONG every 10000ms stomp.js:130
Connected: CONNECTED
version:1.1
server:ActiveMQ/5.9.0
session:ID:Developer1-PC-56865-1406014918730-2:25
heart-beat:10000,10000

index:23
>>> SUBSCRIBE
id:sub-0
destination:/user/queue/greetings

From Machine B (a machine on the same lan) its not working :(, I receive the following console log when I connect (in chrome):

Opening Web Socket... stomp.js:130
Web Socket Opened... stomp.js:130
>>> CONNECT
accept-version:1.1,1.0
heart-beat:10000,10000

Any ideas what could possibly be wrong here?

Thanks!

bcsb1001
  • 2,834
  • 3
  • 24
  • 35
Urbanleg
  • 6,252
  • 16
  • 76
  • 139
  • 1
    check the firewall log to see if its blocking the connection or antivirus --- http://superuser.com/questions/423163/firewall-blocks-websocket – Tasos Aug 03 '14 at 14:51
  • Disable firewall temporarily, as well as anti virus, make sure that both pc's can see each other on the network with 'ping'. – Confuto Aug 03 '14 at 15:15

1 Answers1

0

I had the same issue, I began testing my app from different machines and in some worked, in some didn't, try disabling the antivirus or the firewall. If it connects, try configuring your firewall.

darkconeja
  • 348
  • 3
  • 7