hoaproject / Websocket

The Hoa\Websocket library.
https://hoa-project.net/
423 stars 75 forks source link

Update socket intialization logic to handle ws:// and wss:// application transport #45

Closed shulard closed 9 years ago

shulard commented 9 years ago

I've refactored some objects in the Hoa\Websocket lib and I've added :

The following code allow me to connect to a websocket server :

<?php
use Hoa\Websocket;

$url = "wss://examplehost.com";
$endpoint = "/";

$connection = new Websocket\Connection($url);
$client = new Websocket\Client( $connection, $endoint );
$client->setHost('hoa-project.net');

$client->connect();
var_dump($connection->isConnected()); //bool(true)
$client->close();

This PR is related to :

shulard commented 9 years ago

Also linked to already pushed PR hoaproject/Socket#27 which is a draft about Socket wrapper implementation.

Hywan commented 9 years ago

Not the way to that correctly. See hoaproject/Socket#27.

shulard commented 9 years ago

Not the right way to do that. I close that PR and must create a new one which include the last work on Socket lib.