In an environment without SSL, phpws works fine.
When I try to add SSL to both server and client(below)
Server Side*********************************************
public function __construct() {
$this->server = new WebSocketServer("ssl://bobo.greedio.com:8089", 'superdupersecretkey');
$this->server->addObserver($this);
$this->server->addUriHandler("echo", new DemoEchoHandler());
$this->setupSSL();
}
public function setupSSL() {
$context = stream_context_create();
// local_cert must be in PEM format
stream_context_set_option($context, 'ssl', 'local_cert', './greedio.pem');
stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
stream_context_set_option($context, 'ssl', 'verify_peer', false);
$this->server->setStreamContext($context);
}
Client Side************************************************
function init() {
var host = "wss://bobo.greedio.com:8089/client";
try {
socket = new WebSocket(host);
log('WebSocket - status ' + socket.readyState);
socket.onopen = function(msg) {
log("Welcome - status " + this.readyState);
};
........
}
Client-side immediately disconnect without any error message.
You can try it on https://bobo.greedio.com/phpws/client.html
Later, I wrote a Windows program and try to connect (with ssl), but can be
wired normally.
Someone help?
Original issue reported on code.google.com by Eric.Che...@gmail.com on 30 Jun 2013 at 2:30
Original issue reported on code.google.com by
Eric.Che...@gmail.com
on 30 Jun 2013 at 2:30