Hi,
I managed to get several http calls to work within swish sandbox environment [1], but am not able to get the example from the documentation working – i tried two echo severs – which work when accessed via the browser demo they provide, but not via the code below.
http_open_websocket fails.
Any thoughts why this is the case, would be great:
URL = 'ws://demos.kaazing.com/echo',
http:http_open_websocket(URL, WS, []),
http:ws_send(WS, text('Hello World!')),
http:ws_receive(WS, Reply),
http:ws_close(WS, 1000, "Goodbye").
thank you,
Dan
p.s. i got websocket calls permitted in the sandbox via the following additions when loading custom code into swish:
:- multifile http:http_open_websocket/3.
:- multifile http:ws_send/2.
:- multifile http:ws_receive/2.
:- multifile http:ws_close/3.
sandbox:safe_primitive(http:http_open_websocket/3).
sandbox:safe_primitive(http:ws_send/2).
sandbox:safe_primitive(http:ws_receive/2).
sandbox:safe_primitive(http:ws_close/3).