A problem that has been plagued for a long time, ask the master to give directions. a terminal device sends a request to the server, for example, 192.168.1.9: 8000 response? Serial235678979 & nbsp; request that the response data be & nbsp; aaa333bbb444realtime1 & nbsp; when the application responds, it is normal and can be used. The php programmer has a little more to respond to. it seems that the terminal device cannot work normally for a long time. Ask the experts to give directions.
A terminal device sends a request to the server
For example:
192.168.1.9: 8000/response? Serial = 235678979
The response data is
Aaa = 333
Bbb = 444
Realtime = 1
When the application responds, it is normal and can be used.
The php programmer switched to respond with something more than the terminal device!
If wireshark is used to capture packets, some php header information is added. how can I remove these redundant headers.
Note: The terminal device is normal when the response is changed to direct. It is abnormal when php is used for processing.
------ Solution --------------------
These are all standard http interactions and are mandatory header data. If you want to use php,
1. modify apache and php without losing data (baidu or google)
2. modify the terminal code and generate data according to the http 1.1 protocol.
------ Solution --------------------
If you use file functions to write data to the terminal, there will be no http header.
The key lies in how to know which terminal it is.
------ Solution --------------------
The http header is returned by the web server. do you want the web server to receive http requests without returning the http header? I'm afraid I can't do it. why don't you use php as a socket server.
------ Solution --------------------
Agree to fly first upstairs
This is about the web server. In fact, your response needs to be different from the http protocol, that is, you have to write a headless server by yourself .......