Explorar el Código

Merge pull request #359 from linkec/master

add https to wss upgrade switch protocol
walkor hace 7 años
padre
commit
462bfff44f
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      Protocols/Http.php

+ 6 - 0
Protocols/Http.php

@@ -159,6 +159,12 @@ class Http
                 case 'CONTENT_LENGTH':
                     $_SERVER['CONTENT_LENGTH'] = $value;
                     break;
+                case 'UPGRADE':
+					if($value=='websocket'){
+						$connection->protocol = "\\Workerman\\Protocols\\Websocket";
+						return \Workerman\Protocols\Websocket::input($recv_buffer,$connection);
+					}
+                    break;
             }
         }
 		if(isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE){