2

Here is my problem.

I have a virtual machine, on windows, the Apache server (2.4) is installed on it.

The vm is on the network, so that other people can reach it directly on http://192.168.100.22 (ACTUALLY)

First, everything was going fine with http protocol.

I have setup HTTPS connection to this server. (actually self-signed certificate as it is on local network)

I have a nodeJs server installed and listening on the 9001 port on this machine. This is just supposed to manage websockets.

The actual problem is that NOTHING IS WORKING ANYMORE WITH HTTPS.

NodeServer is configured like this :

var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
//...
http.listen(9001,function(){
    console.log('SERVER LISTENING');
});

On client side, everything as working fine with this kind of connection :

var socket = io('ws://192.168.100.22:9001');

Now that all is going on https protocol, this connection fails.

What do I have to do / change to make my sockets connection work with https protocol? I tried to change it to wss:// instead of ws, tried require('https') instead of http in node server, but nothing working yet...

Last error I faced was :

Cross-origin request blocked

Thanks for help/reading

Julo0sS
  • 163
  • 2
  • 6

0 Answers0