Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138192

Java CometD Jetty protocol equivalent in javascript

$
0
0
    webSocketClient = new WebSocketClient();
    webSocketClient.start();
    wsTransport = new JettyWebSocketTransport(null, null, webSocketClient);
    bayeuxClient = new BayeuxClient(url, wsTransport);
    bayeuxClient.getChannel(someChannel);
    bayeauxClient.handshake(handshakeAuthRequest);

Considering the above Java code works (and everything had been declared), how can I specify the Jetty ClientTransportwsTransport in Javascript (node.js)?

I have tried something along the lines of:

var connection = new comet.CometD();
connection.configure({
    url: url,
    channel: someChannel
}

connection.handshake(handshakeAuthRequest, function (response) {
    console.log(response);
});

But I get an Unknown Bayeaux Transport reason for failure, probably because I have no Jetty transport protocol specified anywhere, nor can I find how to do it for javascript. Part of the response below.

 {
  id: '1',
  successful: false,
  channel: '/meta/handshake',
  failure: {
    reason: 'Unknown Bayeux Transport',
    exception: undefined,
    httpCode: 400,
    connectionType: 'long-polling',
 ......
 }

Viewing all articles
Browse latest Browse all 138192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>