Connect to socket.io(nodejs) via PHP

前端 未结 2 1464
别跟我提以往
别跟我提以往 2021-02-09 15:18

I had a need to connect to websocket via php, send data and immediately disconnect. No need to wait for a response from the socket. I used elefant.io but after updating the libr

2条回答
  •  悲哀的现实
    2021-02-09 15:51

    I also encountered this problem. Learned a lot of structure websocket requests. I wrote a library for yourself, you can use it.PHP SocketIO Client.

    You need simple socket connect to nodejs, compose in this message format.42["message", "your message"]' To encode to hybi10 (or hybi13) and send to websocket

提交回复
热议问题