Net/Notifier/WebSocket/Handshake.php
public function start(
        $host,
        $port,
        $nonce,
        $resource = '/',
        array $protocols = array()
    ) {
        $version = Net_Notifier_WebSocket_Handshake::VERSION;

        $request
            = "GET " . $resource . " HTTP/1.1\r\n"
            . "Host: " . $host . "\r\n"
            . "Connection: Upgrade\r\n"
            . "Upgrade: websocket\r\n"
            . "Sec-WebSocket-Key: " . $nonce . "\r\n"
            . "Sec-WebSocket-Version: " . $version . "\r\n";

        if (count($protocols) > 0) {
            $protocols = implode(',', $protocols);
            $request .= "Sec-WebSocket-Protocol: " . $protocols . "\r\n";
        }

        $request .= "\r\n";

        return $request;
    }
public function start(
        $host,
        $port,
        $nonce,
        $resource = '/',
        array $protocols = array()
    ) {
        $version = Net_Notifier_WebSocket_Handshake::VERSION;

        $request
            = "GET " . $resource . " HTTP/1.1\r\n"
            . "Host: " . $host . "\r\n"
            . "Connection: Upgrade\r\n"
            . "Upgrade: websocket\r\n"
            . "Sec-WebSocket-Key: " . $nonce . "\r\n"
            . "Sec-WebSocket-Version: " . $version . "\r\n";

        if (count($protocols) > 0) {
            $protocols = implode(',', $protocols);
            $request .= "Sec-WebSocket-Protocol: " . $protocols . "\r\n";
        }

        $request .= "\r\n";

        return $request;
    }
public function start ( $ host , $ port , $ nonce , $ resource = '/' , array $ protocols = array ( ) ) { $ version = Net_Notifier_WebSocket_Handshake :: VERSION ; $ request = "GET " . $ resource . " HTTP/1.1\r\n" . "Host: " . $ host . "\r\n" . "Connection: Upgrade\r\n" . "Upgrade: websocket\r\n" . "Sec-WebSocket-Key: " . $ nonce . "\r\n" . "Sec-WebSocket-Version: " . $ version . "\r\n" ; if ( count ( $ protocols ) > 0 ) { $ protocols = implode ( ',' , $ protocols ) ; $ request .= "Sec-WebSocket-Protocol: " . $ protocols . "\r\n" ; } $ request .= "\r\n" ; return $ request ; }
Initiates a WebSocket handshake

@param string  $host      the server host name or IP address.
@param integer $port      the server connection port.
@param string  $nonce     the nonce value used to validate this
handshake.
@param string  $resource  optional. The WebSocket resource name.
@param array   $protocols optional. A list of requested application-
specific sub-protocols. If this array is
specified, only handshake requests for the
specified protocols will succeed.

@return string the HTTP GET request data for initiating a WebSocket
handshake for a WebSocket client.
Initiates a WebSocket handshake