search

Home  >  Q&A  >  body text

Does php5.2.9 support websocket?

Does php5.2.9 support websocket? How to check and where can I find it? Thank you

伊谢尔伦伊谢尔伦2757 days ago532

reply all(1)I'll reply

  • PHPz

    PHPz2017-05-16 13:13:35

    Supported
    First understand the Websocket implementation principle before asking this question.
    WebSocket is an independent protocol built on TCP.
    Websocket performs handshake via 101 status code of HTTP/1.1 protocol.

    So to support websocket, you need to support both HTTP and TCP protocols. The HTTP protocol can be implemented by conventional servers such as nginx/apache. Then you need to support TCP, that is, you need to create a socket.
    socket_create() supports socket creation starting from 4.1
    stream_socket_server() supports starting from 5

    reply
    0
  • Cancelreply