HTTP Connections

xiaoxiao2021-03-06  163

What is HTTP? The HyperText Transfer Protocol (HTTP) is the application protocol used by the web. This section assumes you have a basic understanding of HTTP version 1.1, as defined in RFC 2616. There is no standard way of using HTTP for interactive applications - The Method Described Here Is Just The Way Microsoft Chose to Do It. The Method Described Here Has Nothing to do with the http "connect" method.

How does HTTP work with MSN? Microsoft use gateway.messenger.hotmail.com, port 80, as their dispatch server for HTTP connections. Unlike messenger.hotmail.com this server has never been seen to transfer clients to another notification server. However, There Is a Transfer-Like Function in MSN's Http Method.

Though HTTP is most often used for transferring HTML documents (hence the name), it's entirely capable of transferring any kind of data. In HTTP, there is no way for the server to send a message to the client without the client requesting it first. MSN Messenger clients send commands in the body of HTTP an request, and the server queues commands to send in the body of a response. When the client has no commands to send for a few seconds, it should "poll" the server for new messages . The official client..........

Once a client has sent an HTTP request, it must wait for the response to come back before sending another request. For example, if you poll the server then send a command without waiting for the response to the poll, you will receive an HTTP 400 Error (Bad Request).

Normally, a single connection to the server is kept alive throughout an MSN Messenger session, but the protocol seems to support a connection being broken and re-established without the session being affected. This has not yet been tested in practice, though.In your Initial Profile, The "Clientport" is set to 0 in an http connection, and sending png will cause the server to send an http error and disconnect you. OtherWise, The Protocol Works as Normal.

HTTP Issues in the Official ClientMost of the testing for this page was done with version 5 of the official client, which has fairly poor support for HTTP connections, including several bugs and design flaws. Version 5 is the first even to make the option easily available SO IT HAS PRESUMABLY NOT BEEN THOROUGHLY TESTED. Hopefully, this will be improved in Future Versions.

The official client misbehaves badly when using HTTP proxies operating on a port other than 80. It does not always obey the "one request at a time" rule, so it occasionally gets kicked off with a 400 error. The configuration menu confusingly associates " using an HTTP proxy server "with" using a SOCKS proxy server ". The proxy server in an HTTP session performs a completely different function to that in a SOCKS connection, and is most likely not required by the protocol. More seriously, some HTTP proxies are intercept and proxy HTTP connections without the client's knowledge. The official client can not handle these "transparent proxies" at all. Finally, if you specify an HTTP proxy server, the official client will ignore the setting to enable or disable its use. Instead, it will always try to connect directly to MSN Messenger first, then through HTTP if that fails.Protocol DescriptionIn an HTTP connection, commands are sent to MSN Messenger with POST requests to a CGI script, and received in responses to those commands. The initial request opens a new notification or switchboard server session, and (for a notification server session) should be sent to gateway.messenger.hotmail.com or (for a switchboard server session) the IP address given in an XFR. Commands you wish to send are contained in the entity-body, one per request (including one in the initial request). When there are no messages to send for a few seconds (two seconds in the official client), the client SHOULD POLL The Server for Queued Commands.

Server responses contain an "X-MSN-Messenger" header, which includes an IP address to send the next request to and a session ID to send with the next request. If the session is being closed, this header will also include a "Session = Close "Value. The session ID Seems Always to Be a long (Which Remains Constant Across A Session), FOLLOWED BY A DOT, THEN Short Number (Which Changes with Each Response) - Treation - Treation it as an arbitrary string.The official client tries to keep a single connection open throughout a session, though the session ID is presumably included in case a proxy server along the way closes the connection in the middle of a session. Assuming the server doesn ' T Trminate Your session WHEN A Connection Is Closed, You Must Send Out To Close Your Connection (or Wait For A Time-Out on The Server).

The script is /gateway/gateway.dll, and it takes the folloading arguments:

Action Either "open" (to open a new session) or "poll" (to receive queued commands without sending any commands). Non-empty requests after the first do not include an "Action" parameter. Server Used with "Action = p "to specify the Type of Server to Open. The value can be used" ns "or" sb ". ip buy with" action = Open "to specify the . IP address or domain name of the server SessionID Sent with every request after the first in a session, this is the string given in the previous response The official client sends. "Proxy-Connection: Keep-Alive" and "Pragma: No- Cache "headers, which are HTTP / 1.0 headers that have been replaced by" Connection:. Keep-Alive "in HTTP / 1.1 presumably, these are included incase requests pass through old or buggy proxies on the way to the server The official client. Also Sends "User-Agent: MSMsgs", Though The Server Doesn't Discriminate Based on The user-agent.examples requests and responsesb ecause the URLs in the HTTP examples are so large, having them on this page caused horizontal scrolling which caused difficulties in reading the information above. You may see the examples in this page.

转载请注明原文地址:https://www.9cbs.com/read-128213.html

New Post(0)