Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users
    1. Home
    2. antonio.mestre
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    antonio.mestre

    @antonio.mestre

    0
    Reputation
    23
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    antonio.mestre Unfollow Follow

    Latest posts made by antonio.mestre

    • Flic HUB SDK Error connecting to a remote websocket server (wss)

      Hello,

      I'm trying to connect my HUB to a remote websocket server, but none of the solutions i tried worked. I'm using the 'net' library becausa is the given by SDK and i can't use others like socket.io. The server domain starts with "wss://...", but if i use it, that gives me an Error ECONNREFUSED (connection refused). If i remove the part "wss://..." of the domain and set the port to 443 IT SAYS THAT THE CONNECTION WAS MADE, but i checked my server and the HUB IS NOT CONNECTED to the WSS server.
      If i use the same code, but changing the server domain to a local ip address it works fine. So i don't know if the problem is the fact that is a remote WSS server, but i think the code is not wrong.

      Code :

      var client1 = net.createConnection(433, domain, function() {
      console.log("Connected")
      });

      client1.on("data", function (data) {
      console.log(data.toString());
      })

      client1.on("end", function () {
      console.log("ended");
      })

      client1.on("error", function (data) {
      console.log(data);
      })

      posted in Developers flic hub sdk websocket net server
      antonio.mestre
      antonio.mestre