jo2 jo2 - 1 year ago 76
Javascript Question

OpenWhisk - - client possible?

I am trying to use from OpenWhisk action. I want to use it as a WebSocket client, but cannot seem to get it to work. Is client supported,
or is it only as server?

EDIT a client sample from

var io = require('');
var socket = io('ws://');
socket.on('connect', function () {

This gives TypeError undefined is not a function. (on the io(...).

I guess one has to stand up a ws server, like in the Node.js samples on the same page...?!



OpenWhisk currently does not support a websocket client library as part of the Node.js action containers. The packages currently supported are listed here. I've opened an issue to add the most commonly used ones to this image as the use-case you laid out (running an OpenWhisk action and pushing to a websocket) sounds very useful. itself only seems to be able to spin up a server, which is not suitable for an OpenWhisk action, as it is very short-running. (I suggested to add that) is needed to connect to a Websocket server.