Conditions | 4 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function handshake($request) |
||
34 | { |
||
35 | $key = $request->headers->get('Sec-WebSocket-Key'); |
||
36 | if( |
||
37 | strtolower($request->headers->get('Upgrade')) != 'websocket' || |
||
38 | !$this->checkProtocolVrsion($request) || |
||
39 | !$this->checkSecKey($key) |
||
40 | ){ |
||
41 | return false; |
||
42 | } |
||
43 | $acceptKey = $this->generateAcceptKey($key); |
||
44 | $response = new ResponseWebSocket(); |
||
45 | $response->headers->set('Sec-WebSocket-Accept', $acceptKey); |
||
46 | |||
47 | return $response; |
||
48 | } |
||
49 | |||
67 |