How does sockets work in php [closed]

2

I've been lately having to work with real-time updates, so I've been trying to figure out the sockets, more specifically to use in php. I'm doing a simple example based on in these codes , the problem is that when sending the form the page generates refresh anyway, in the case I would have to use jQuery.ajax to send the request without refresh? I'm kind of lost.

I understand more or less how it works after a long drill on the internet, however when sending a message with socket.send () the server returns this: GET / HTTP / 1.1 Host: 127.0.0.1:3500 Connection: Cache-Control: no-cache Upgrade: websocket Origin: link Sec-WebSocket-Version: 13 User-Agent: Mozilla / 5.0 (Windows NT 6.1) AppleWebKit / 537.36 (KHTML, like Gecko) Chrome / 59.0.3071.115 Safari / 537.36 Accept-Encoding: gzip, deflate, br Accept-Language: en, q = 0.8, en-US; q = 0.6, en; q = 0.4 Sec-WebSocket-Key: 9cUxYx7abplnX8 + wXBvZug == Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

    
asked by anonymous 28.06.2017 / 01:24

0 answers