How to configure from WS to WSS in Apache Server
I am trying to use **Ratchet** Library for **websocket** in PHP for sample hello world applicatation given in this link: http://socketo.me/docs/hello-world

The simple hello world application was working well in http://localhost in my xampp server in local computer.

But then I deployed my application to **Amazon AWS EC2 Ubuntu** with **Apache2** as server where I am using **https**. 

_My hello world application of websocket is not working there._

**chat-server.php** ( Same as given in http://socketo.me/docs/hello-world )

```
<?php
use Ratchet\Server\IoServer;
use MyApp\Chat;

    require dirname(__DIR__) . '/vendor/autoload.php';

    $server = IoServer::factory(
        new Chat(),
        8080
    );

    $server->run();
```

**index.php**

```
var conn = new WebSocket('ws://my_demo_site.com:8080');
conn.onopen = function(e) {
    console.log("Connection established!");
};

conn.onmessage = function(e) {
    console.log(e.data);
};
```

I am getting error like this in my console of google chrome when i open the site with https://my_demo_site.com :

**Mixed Content: The page at 'https://my_demo_site.com/index.php' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://my_demo_site.com:8080/'. This request has been blocked; this endpoint must be available over WSS.**

**How can I migrate from WS to WSS in this case?**