Protocols/MSNP/Gateway: Difference between revisions

From NINA Wiki
Jump to navigation Jump to search
(Created page with "Convert from markdown: <pre> Here is some information about the HTTP gateway used by Messenger if it fails to connect directly to the MSNP server (port 1863). ## Hosts ```...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Convert from markdown:
{{Protocols/MSNP}}


<pre>
Here is some information about the HTTP gateway used by Messenger if it fails to connect directly to the MSNP server (port 1863).
Here is some information about the HTTP gateway used by Messenger if it fails to connect directly to the MSNP server (port 1863).


## Hosts
== Hosts ==


```
<pre>
gateway.messenger.hotmail.com
gateway.messenger.hotmail.com
muser.gateway.messenger.hotmail.com
muser.gateway.messenger.hotmail.com
```
</pre>


## Implementation
== Implementation ==


The gateway is just a proxy for Messenger commands.
The gateway is just a proxy for Messenger commands.


### First request
=== First request ===
 
The first request is a POST request to the URL <code>/gateway/gateway.dll?Action=open&Server={server type}&IP={server the client tried to connect to}</code>.
The first request is a POST request to the URL: `/gateway/gateway.dll?Action=open&Server={server type}&IP={server the client tried to connect to}`


`{server type}` is either `NS` (MSNP server) or `SB` (SwitchBoard server)
<code>{server type}</code> is either <code>NS</code> (Notification server) or <code>SB</code> (Switchboard server).


The POST body is the `VER` command.
The POST body is the <code>VER</code> command.


This first request should trigger the creation of a session ID in the database. This session ID will be present in the URLs of all subsequent requests to the gateway.
This first request should trigger the creation of a session ID in the database. This session ID will be present in the URLs of all subsequent requests to the gateway.


This session ID along with the gateway IP address should be sent in an `X-MSN-Messenger` header:
This session ID along with the gateway IP address should be sent in an <code>X-MSN-Messenger</code> header:
`"X-MSN-Messenger": "SessionID={session ID}; GW-IP={IP of the gateway service}"`
<code>"X-MSN-Messenger": "SessionID={session ID}; GW-IP={IP of the gateway service}"</code>


A `Content-Type` header should be added as well:
A <code>Content-Type</code> header should be added as well:
`"Content-Type": "application/x-msn-messenger"`
<code>"Content-Type": "application/x-msn-messenger"</code>


The body of the response is simply the response to the command.
The body of the response is simply the response to the command.


### Subsequent requests:
=== Subsequent requests ===


#### Type 1: `/gateway/gateway.dll?SessionID={session ID}`
==== Type 1: <code>/gateway/gateway.dll?SessionID={session ID}</code> ====


The client wants to send a command to the server. The command is in the POST body. Answer with the command response and include the 2 headers as shown above.
The client wants to send a command to the server. The command is in the POST body. Answer with the command response and include the 2 headers as shown above.


#### Type 2: `/gateway/gateway.dll?Action=poll&SessionID={session ID}`
==== Type 2: <code>/gateway/gateway.dll?Action=poll&SessionID={session ID}</code>====


The client wants to know if the server has queued any specific command(s) for the current session. Answer with the specified command(s). If the client has no commands to poll, send an empty reply. Include the 2 headers.
The client wants to know if the server has queued any specific command(s) for the current session. Answer with the specified command(s). If the client has no commands to poll, send an empty reply. Include the 2 headers.
</pre>
</pre>

Latest revision as of 10:03, 24 October 2022

MSNP Protocol
IntroductionTermsClients
Reference
Error ListCommandsRelying Party SuiteSpotlife
Services
XMPPHTTP GatewayTabsActivities
Documentation
Development ToolsMSNP Grid
PolygamyURLs used by MSN
Documents
Protocol Versions
Version 21
Version 18
Version 16
Version 15
Version 14
Version 13
Version 12
Version 11
Version 9
Version 8
Version 2
MSNC
IntroductionP2PObject DescriptorDisplay PicturesFile Transfer
Scenarios
Microsoft Messenger for Mac
MSNP on WebTV (MSNTV)

Here is some information about the HTTP gateway used by Messenger if it fails to connect directly to the MSNP server (port 1863).

Hosts

gateway.messenger.hotmail.com
muser.gateway.messenger.hotmail.com

Implementation

The gateway is just a proxy for Messenger commands.

First request

The first request is a POST request to the URL /gateway/gateway.dll?Action=open&Server={server type}&IP={server the client tried to connect to}.

{server type} is either NS (Notification server) or SB (Switchboard server).

The POST body is the VER command.

This first request should trigger the creation of a session ID in the database. This session ID will be present in the URLs of all subsequent requests to the gateway.

This session ID along with the gateway IP address should be sent in an X-MSN-Messenger header: "X-MSN-Messenger": "SessionID={session ID}; GW-IP={IP of the gateway service}"

A Content-Type header should be added as well: "Content-Type": "application/x-msn-messenger"

The body of the response is simply the response to the command.

Subsequent requests

Type 1: /gateway/gateway.dll?SessionID={session ID}

The client wants to send a command to the server. The command is in the POST body. Answer with the command response and include the 2 headers as shown above.

Type 2: /gateway/gateway.dll?Action=poll&SessionID={session ID}

The client wants to know if the server has queued any specific command(s) for the current session. Answer with the specified command(s). If the client has no commands to poll, send an empty reply. Include the 2 headers.