Autobahn-java still only support WAMP1 now?

38 views
Skip to first unread message

pushy.zh...@gmail.com

unread,
Oct 2, 2018, 10:31:25 PM10/2/18
to Autobahn

I try connect WAMP server:

WebSocketOptions options = new WebSocketOptions();
options.setReconnectInterval(5000);
try {
   mConnection.connect(hostname, new WebSocketConnectionHandler() {
       @Override
       public void onOpen() {
           Log.d(TAG, "open");
      }

       @Override
       public void onMessage(String payload) {
           Log.d(TAG, "received => " + payload);
      }

       @Override
       public void onClose(int code, String reason) {
           Log.d(TAG, "closed => " + reason);
      }
  }, options);
} catch (WebSocketException e) {
   e.printStackTrace();
}

but throw some error:

closed => Server error 400 (This server only speaks WebSocket subprotocols wamp.2.cbor.batched, wamp.2.cbor, wamp.2.msgpack.batched, wamp.2.msgpack, wamp.2.ubjson.batched, wamp.2.ubjson, wamp.2.json.batched, wamp.2.json)

Is autobahn-java only support WAMP1 or other configuration required?

Omer Akram

unread,
Oct 3, 2018, 3:13:28 AM10/3/18
to Autobahn
Hi!

Actually autobahn-java is WAMPv2 only, it does not support WAMPv1.

The problem with your code is that you are trying to make a WebSocket connection are expecting it to talk WAMPv2 :)


HTH,
Cheers!

pushy.zh...@gmail.com

unread,
Oct 3, 2018, 3:49:00 AM10/3/18
to Autobahn
Thanks for your reply!!!

在 2018年10月3日星期三 UTC+8下午3:13:28,Omer Akram写道:
Reply all
Reply to author
Forward
0 new messages