For a long time-consuming question, ask the master to give directions.

Source: Internet
Author: User
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 .......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.