You are reading a single comment by @Wilberforce and its replies. Click here to read the full conversation.
  • Ok, I think the issue is that by default the WebSocket example just uses the net library to initialise a connection, not tls: https://github.com/espruino/EspruinoDocs/blob/master/modules/ws.js#L94

    So ideally changing the library to do this:

    WebSocket.prototype.initializeConnection = function () {
      require("tls").connect({
        host: this.host,
        port: this.port
      }, this.onConnect.bind(this));
    };
    

    would probably work. Unfortunately the way it's done (not actually exporting WebSocket itself) means that you can't actually modify just that function when loading in the library - you'd have to copy the module, change it, and load it in yourself.

About

Avatar for Wilberforce @Wilberforce started