<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[[实践OK]Telnet模拟http请求下的Host设置HOST: justwinit.cn实例,POST/GET。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Wed, 12 Aug 2015 09:35:42 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	首先，用 telnet 链接WEB服务器：<br/>telnet 172.21.73.12 80<br/>键入下面两行命令，然后回车2次，即可得到HTTP响应（下面的命令是get index.html文件，请根据你测试的server的实际情况修改这个参数）。<br/>GET /index.html HTTP/1.1<br/>host:172.21.73.12:80&nbsp;&nbsp;#如果IP就能访问到，不需要虚拟域名，则可以不写host这行，直接两次回车即可。<br/><br/>响应的结果如下所示：<br/>HTTP/1.1 200 OK<br/>Date: Thu, 30 Jul 2009 03:42:18 GMT<br/>Server: Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch5~pu1 mod_perl/2.0.2 Perl/v5.8.8<br/>Last-Modified: Thu, 30 Jul 2009 03:21:07 GMT<br/>ETag: &quot;320692-19e-cb5d6ec0&quot;<br/>Accept-Ranges: bytes<br/>Content-Length: 414<br/>Content-Type: text/html; charset=UTF-8<br/>来自：http://blog.chinaunix.net/uid-20644632-id-68039.html<br/><br/>可以用来排查一下那个网路的问题：<br/><textarea name="code" class="php" rows="15" cols="100">
curl &quot;http://101.200.228.135:1218/?name=video&amp;opt=status&quot;
[root@XD_xiyou_mqp_10 ~]# telnet 101.200.228.135 1218
Trying 101.200.228.135...
telnet: connect to address 101.200.228.135: Cannot assign requested address
telnet: Unable to connect to remote host: Cannot assign requested address #为何出现如下问题原因及解决办法：http://jackxiang.com/post/8460/
[root@XD_xiyou_mqp_10 ~]# telnet 101.200.228.135 1218
Trying 101.200.228.135...
Connected to localhost (101.200.228.135).
Escape character is &#039;^]&#039;.
GET /?name=video&amp;opt=status HTTP/1.1

HTTP/1.1 200 OK
Content-Type: text/plain
Cache-Control: no-cache
Connection: close
Date: Tue, 26 Jan 2016 03:37:17 GMT
Content-Length: 224

HTTP Simple Queue Service v1.7
------------------------------
Queue Name: video
Maximum number of queues: 1000000
Put position of queue (1st lap): 528637
Get position of queue (1st lap): 470814
Number of unread queue: 57823
Connection closed by foreign host
</textarea><br/><br/>——————————————————————————————<br/>实践OK如下：<br/><textarea name="code" class="php" rows="15" cols="100">
[root@iZ25dcp92ckZ multepoolserver]# telnet jackxiang.com 80
Trying 101.200.228.135...
Connected to jackxiang.com.
Escape character is &#039;^]&#039;.
GET /index.html HTTP/1.1
host:101.200.228.135:80

HTTP/1.1 200 OK
Server: nginx
Date: Wed, 25 Nov 2015 05:57:19 GMT
Content-Type: text/html
Content-Length: 3549
Last-Modified: Sat, 16 May 2015 01:53:43 GMT
Connection: keep-alive
ETag: &quot;5556a327-ddd&quot;
Accept-Ranges: bytes

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head lang=&quot;en&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;meta charset=&quot;UTF-8&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;E家小区&lt;/title&gt;
</textarea><br/><br/>不用这么复杂，但有一个问题，用telnet手打的话就写个 GET /&nbsp;&nbsp;就好了<br/>这host没有设置，访问默认到ip了： curl -H&quot;Host:jackxiang.com&quot; ...怎么体现在telnet里：<br/><textarea name="code" class="php" rows="15" cols="100">
[root@iZ25dcp92ckZ multepoolserver]# telnet jackxiang.com 80
Trying 101.200.228.135...
Connected to jackxiang.com.
Escape character is &#039;^]&#039;.
GET /index.html HTTP/1.1
host:101.200.228.135:80

HTTP/1.1 200 OK
Server: nginx
Date: Wed, 25 Nov 2015 05:57:19 GMT
Content-Type: text/html
Content-Length: 3549
Last-Modified: Sat, 16 May 2015 01:53:43 GMT
Connection: keep-alive
ETag: &quot;5556a327-ddd&quot;
Accept-Ranges: bytes

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head lang=&quot;en&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;meta charset=&quot;UTF-8&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;E家小区&lt;/title&gt;
</textarea><br/><br/>得用ip去连接后，写Host才行，如下：<br/><textarea name="code" class="php" rows="15" cols="100">
telnet 101.200.228.135 80
Trying 101.200.228.135...
Connected to 101.200.228.135.
Escape character is &#039;^]&#039;.
GET /index.php HTTP/1.1
HOST: jackxiang.com

HTTP/1.1 200 OK
Server: nginx
Date: Wed, 25 Nov 2015 06:08:46 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.4.44
Last-Modified: Tue, 24 Nov 2015 19:06:34 GMT
ExpiresWed, 25 Nov 2015 07: 06:34 +0000
Cache-Control: max-age=43200
Content-Encoding: gzip
Vary: Accept-Encoding
</textarea><br/><br/>=================================================================================<br/>Telnet Post/Get&nbsp;&nbsp;实现方式：<br/>Get方式<br/>1. telnet 192.168.1.110 80，连接上之后。<br/>2. <br/><br/>windows doc命令行下：ctrl键 + &#039;]&#039; 键 进入输入模式，接着按回车切换到显式输入模式（可以显示输入的字符）<br/><br/>linux命令行则不需要此此操作。<br/><br/> <br/><br/>3. 输入http头部，两次回车(&#92;r&#92;n)。<br/><br/>GET&nbsp;&nbsp;/api.do?user=charlie&amp;pwd=w2ss42&nbsp;&nbsp; HTTP/1.0<br/><br/>Content-Type: text/html; charset=UTF-8<br/> <br/><br/>POST方式<br/>1. telnet 192.168.1.110 80，连接上之后。<br/>2. 同上。<br/><br/> <br/><br/>3. 输入http头部，两次回车(&#92;r&#92;n)，接着输入post参数。<br/><br/>POST&nbsp;&nbsp; /api.do&nbsp;&nbsp; HTTP/1.0<br/><br/>Content-Type: application/x-www-form-urlencoded&nbsp;&nbsp;<br/><br/>Content-Length: 15<br/><br/><br/>user=charlid&amp;pwd=w2ss42 <br/><br/><br/><textarea name="code" class="php" rows="15" cols="100">
#telnet 123.57.252.183 80
Trying 123.57.252.183...
Connected to 123.57.252.183.
Escape character is &#039;^]&#039;.
GET /Api/testup HTTP/1.1
host:123.57.252.183:80

HTTP/1.1 200 OK
Server: EasySwoole
Content-Type: text/html; charset=UTF-8;
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With
Connection: keep-alive
Date: Wed, 04 Sep 2019 14:44:26 GMT
Transfer-Encoding: chunked

1e0
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;
&lt;title&gt;鸡蛋图片上传测试其是否能孵化Demo上传页&lt;/title&gt;
</textarea><br/>POST/GET 来自：http://blog.csdn.net/xiongli880612/article/details/40300861<br/>来源2：http://blog.csdn.net/fym0121/article/details/7647887<br/>==========================一个哥们是IOS上这样就行，我发现不行======================================<br/>http GET http://jackxiang.com&nbsp;&nbsp;&nbsp;&nbsp;GET必须大写，否则返回：400 Bad Request：<br/><textarea name="code" class="php" rows="15" cols="100">
[root@iZ25dcp92ckZ multepoolserver]# telnet jackxiang.com 80
Trying 101.200.228.135...
Connected to jackxiang.com.
Escape character is &#039;^]&#039;.
http GET http://jackxiang.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //GET /index.html 
HTTP/1.1 400 Bad Request
Server: nginx
Date: Wed, 25 Nov 2015 03:56:10 GMT
Content-Type: text/html
Content-Length: 166
Connection: close

&lt;html&gt;
&lt;head&gt;&lt;title&gt;400 Bad Request&lt;/title&gt;&lt;/head&gt;
&lt;body bgcolor=&quot;white&quot;&gt;
&lt;center&gt;&lt;h1&gt;400 Bad Request&lt;/h1&gt;&lt;/center&gt;
&lt;hr&gt;&lt;center&gt;nginx&lt;/center&gt;
&lt;/body&gt;
&lt;/html&gt;
Connection closed by foreign host.
</textarea><br/><br/><br/>本文转载自：http://www.cnblogs.com/stg609/archive/2008/07/06/1237000.html<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1、打开&quot;运行&quot;-&gt;cmd进入命令环境；<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2、输入&quot;telnet www.baidu.com 80&quot;，回车后 ,屏幕为全黑，此时我们利用快捷键&quot;Ctrl+](右中括号)&quot;来打开本地回显功能，这样我们就可以看见我们所打的东西了，如图：（注本阶段执行过程和以下的过程均要求操作时间尽可能短，因为时间一长，便会被认为断开连接。）<br/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3、单击回车，进行编辑状态。<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4、输入：&quot;GET / HTTP/1.1&quot;后回车,在第二段接着输入：&quot;HOST:&quot;然后按回车，这样一个简单的HTTP请求就完成了，接着我人只要再按下回车，便向服务器递交这个请求了。如图：（我们来看一下这个是什么意思：GET表示请求方式，/表示请求的根目录下的文件，HTTP/1.1表示HTTP协议版本，HOST就是一个消息头，据某些朋友说1.1的版本一定要加一个&quot;HOST:&quot;可是我实验后发现&quot;HOST :&quot;不加仍旧可以正常发送请求，但是GET HTTP这个必须大写，否则就该请求无法发送）<br/> <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5、接收服务器返回，这步其实不需要我们来做，因为当我们发送请求后，只需几秒钟，我们便会收到来自服务器反应.<br/><br/> <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6、这样,请求就算完成了。下面我们在百度中搜一下&quot;1&quot;,浏览器中的地址应该是:http://www.baidu.com/s?wd=1.看看请求是怎么样的<br/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;怎么样，大家会了吗？以上只是用GET方式进行请求，当然还可以用POST方式进行请求，只是POST我这不方便做实验，所以就不写了。大概的格式给大家参考下：<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;POST /localhost/login.aspx HTTP/1.1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HOST:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Content-Type:application/x-www-form-urlencoded<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Content-Length:10<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uid=xxxxxx
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]Telnet模拟http请求下的Host设置HOST: justwinit.cn实例,POST/GET。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>