MSN Protocol – 代理« Focusheart's World

1.1.1.?Order?of?Commands?|?指令顺序

Data?sent?to?and?from?the?server?are?divided?into?commands?as?explained?in?the?.?The?server?and?client?can?send?multiple?commands?in?a?packet,?or?spread?out?one?command?over?multiple?packets.?Writing?a?client?that?parses?data?by?packets?is?not?a?good?method.

往来与服务器的数据按照指令进行划分,在指令页中有说明。服务器与客户端在一个数据包中可以发送多个命令,同样也可以将一个命令扩展至几个包中。通过分析包来写客户端不是一个好主意。

All?normal?commands?end?with?a?newline.?Special?types?of?commands?specify?the?length?of?the?body?in?bytes.?When?writing?functions?to?parse?commands,?you?will?need?to?separate?commands?by?newlines,?except?when?receiving?special?commands?with?specified?lengths.

所有的指令以换行符结束。一些特别的指令说明了消息体的长度。当写解析指令函数时,你需要用换行符来分隔指令,除了那些指定长度的特别指令。

1.1.1.1.?HTTP?Connections?|?HTTP连接。

In?order?to?use?MSN?in?some?highly?restrictive?environments,?it?is?possible?to?wrap?up?an?MSN?Messenger?session?in?HTTP?requests?and?responses.?This?is?slow?and?wasteful?of?bandwidth,?so?end-users?should?be?discouraged?from?using?it?when?normal?connections?are?possible.?This?type?of?connection?is?explained?in?the?.

为了在一些高受限环境下使用MSN,可能会将MSN?Messenger会话在HTTP请求与相应中包裹。这是很慢并且浪费带宽的,所以如果正常连接是可用的,不建议使用这种方式。这种连接方式在HTTP连接页中有说明。

1.1.2.?Proxies?|?代理

A?proxy?server?is?a?program?which?takes?messages?from?one?side?of?a?connection,?processes?them,?and?may?or?may?not?forward?them?to?the?destination.?Proxies?can?be?used?to?reduce?bandwidth?(e.g.?by?providing?a?local?cache?for?web?pages),?increase?security?(e.g.?by?requiring?a?username?and?password?before?allowing?connections),?or?any?number?of?other?reasons.

代理是一种将消息从连接一段转发至另一端的程序,代理可以用来降低带宽(比如提供本地缓存网页),提高安全性(在允许连接前要求用户名密码),或者种种其他原因。

A?good?proxy?server?should?be?invisible?(or?almost?invisible)?to?the?destination?server,?so?you?are?free?to?support?whichever?proxy?servers?you?like.?The?official?client?supports?SOCKS?versions?4?and?5?proxies?for?use?with?normal?connections,?and?HTTP?proxies?for?use?with?.

优秀的代理服务器应该是对目标服务器透明的(或者基本透明),所以你可以自由选择代理服务器。官方客户端支持SOCKS4或者SOCKS5代理服务器的正常连接,HTTP代理使用HTTP连接。

1.1.2.1.?SOCKS

SOCKS?(which?just?stands?for?SOCKetS)?is?a?very?mature?protocol,?designed?for?use?by?general-purpose?proxy?servers?on?networks?that?want?to?control?access?to?the?public?Internet.?Unlike?most?applications?protocols,?which?are?used?for?some?particular?purpose?(e.g.?MSN?Messenger?is?used?for?instant?messaging),?SOCKS?is?just?used?to?tunnel?connections.

SOCKS(其实就是SOCKetS的意思)是一个非常成熟的协议,可以在网络上用作通用代理服务器以访问公共网络。不像其他大多数应用程序的协议都是用作特定用途(比如MSN?Messenger用作即时消息),SOCKS只是一个隧道连接。

SOCKS?version?4?is?specified?at?,?the?version?4a?extension?is?specified?at?,?and?version?5?is?specified?at?.?SOCKS4?only?supports?TCP?connections,?but?SOCKS5?adds?support?for?UDP,?ICMP,?and?other?less?widely?used?transport?protocols.?You?should?be?able?to?find?a?SOCKS?library?for?your?chosen?operating?system?and?programming?language.?If?not,?you'll?have?to?write?it?yourself?based?on?the?protocol?specifications,?above.

SOCKS4在这里有详述。而4a扩展则在这里有详述,SOCKS5在RFC1928中有详述。SOCKS5只支持TCP连接,SOCKS5添加了UDP,ICMP以及一些用的较少的传输协议。你可以为你的操作系统和语言可以找到SOCKS库。如果没有,你得基于协议规范自己写一个。

1.1.2.2.?HTTP?Proxies?|?HTTP代理

If?you're?wrapping?MSN?in?an?,?you?can?use?an?HTTP?proxy.?HTTP?version?1.1?(defined?in?),?was?designed?with?proxy?servers?in?mind.?All?HTTP?requests?must?include?the?complete?URL?of?the?resource?being?requested,?so?using?an?HTTP?proxy?server?normally?just?means?opening?a?connection?to?your?proxy?server?instead?of?the?server?you?really?want?to?contact?-?the?proxy?server?will?detect?where?your?request?is?supposed?to?go?based?on?the?URL.

如果你将MSN包裹在HTTP连接中,你可以使用HTTP代理。HTTP?1.1(在RFC2616中定义)具备了代理服务器的设计。所有的HTTP请求必须包含完整的请求资源的URL,所以使用HTTP代理表示对HTTP代理服务器进行操作而非实际的服务器,而代理服务器会检测你所请求的URL。

Some?HTTP?proxy?servers?may?require?you?to?include?special?headers?-?for?example,?to?authenticate?yourself?with?the?proxy?server.? defines?these?headers,?and?the? discusses?the?behaviour?of?the?official?client.

有些HTTP代理服务器要求你使用特别的header,比如,验明正身这样。RFC?2616定义了header,另外HTTP?Connections?Page讨论了官方客户端的行为。

郑重声明:资讯 【MSN Protocol – 代理« Focusheart's World】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——