J jtare Active Member Licensed User Longtime User Jan 11, 2020 #1 Looking in the autobahn websocket github I noticed that the connect method allow you to insert headers, obviously the websocket wrapper doesn't allow you to set them, but can that part of the library be called by using a javaobject or with the reflection library? And what's the proper way to do it? I tried this but it didn't work: Code: Dim jo As JavaObject jo.InitializeContext jo = ws jo.RunMethod("connect",Array As Object(Url,Null,Null,Null,CreateMap("Auth":"123"))) This is the java method: Code: @Override public void connect(String wsUri, String[] wsSubprotocols, IWebSocketConnectionHandler wsHandler, WebSocketOptions options, Map<String, String> headers) throws WebSocketException { I believe the "IWebSocketConnectionHandler wsHandler" is important and shouldn't pass null value. Thanks.
Looking in the autobahn websocket github I noticed that the connect method allow you to insert headers, obviously the websocket wrapper doesn't allow you to set them, but can that part of the library be called by using a javaobject or with the reflection library? And what's the proper way to do it? I tried this but it didn't work: Code: Dim jo As JavaObject jo.InitializeContext jo = ws jo.RunMethod("connect",Array As Object(Url,Null,Null,Null,CreateMap("Auth":"123"))) This is the java method: Code: @Override public void connect(String wsUri, String[] wsSubprotocols, IWebSocketConnectionHandler wsHandler, WebSocketOptions options, Map<String, String> headers) throws WebSocketException { I believe the "IWebSocketConnectionHandler wsHandler" is important and shouldn't pass null value. Thanks.
Erel B4X founder Staff member Licensed User Longtime User Jan 12, 2020 #2 It is not possible to add the headers with JavaObject. Upvote 0