13 366 ms 350 ms 345 ms 118.155.194.5 14 365 ms 374 ms 369 ms otecbb103.kddnet.ad.jp [124.211.33.65] 15 347 ms 353 ms 358 ms otejbb203.kddnet.ad.jp [59.128.4.61] 16 360 ms 360 ms 432 ms cm-ote231.kddnet.ad.jp [118.155.197.12] 17 365 ms 372 ms 375 ms 125.29.25.162 18 234 ms 249 ms 223 ms rt-core01-ge-1-10.dnp.ad.jp [210.133.110.38] 19 250 ms 245 ms 246 ms sw-cust101-ge-0-1.dnp.ad.jp [210.133.110.90] 20 * * * Request timed out. 21 * * * Request timed out. 22 * * * Request timed out.估计210.133.110.90机房的放火墙做了限制。禁止ping、所以ping不通了
==== start up 07/24/09 17:35:25 ===== <HTML><HEAD> <TITLE>501 Method Not Implemented</TITLE> </HEAD><BODY> <H1>Method Not Implemented</H1> xxx to /index.html not supported.<P> Invalid method in request \x80<P> <HR> <ADDRESS>Apache/1.3.37 Server at 127.0.0.1 Port 80</ADDRESS>我用我的程序测试过,你可以的,你的程序还是有问题。
这位大哥,我现在用代理也连通了,就是直接向210.133.109.190发送Http请求,服务器可以返回内容,只是返回的有问题,能不能帮我看看。返回内容是: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /cgi-bin/msrs/getvics.cgi was not found on this server.</p> </body></html>我发送HTTP请求的代码如下: strcat(m_cRequestHeader, "POST "); strcat(m_cRequestHeader, "/cgi-bin/msrs/getvics.cgi"); strcat(m_cRequestHeader, " HTTP/1.1"); strcat(m_cRequestHeader, "\r\n"); strcat(m_cRequestHeader, "Content-Type: text/xml; charset=UTF-8\r\n"); strcat(m_cRequestHeader, "Accept: */*\r\n"); strcat(m_cRequestHeader, "Connection: Keep-Alive\r\n"); strcat(m_cRequestHeader, "User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)\r\n"); strcat(m_cRequestHeader, "x-protocol-version:1.0\r\n"); //host name strcat(m_cRequestHeader, "Host:"); strcat(m_cRequestHeader, "210.133.109.190"); strcat(m_cRequestHeader,":"); strcat(m_cRequestHeader, "80"); strcat(m_cRequestHeader, "\r\n");以上的Http请求有什么问题吗?这个URL应该是没有问题的,因为用浏览器访问是可以的,URL如下:http://210.133.109.190/cgi-bin/msrs/getvics.cgi
标准格式如下 GET /PointForum/ui/styles/default/topic/bgButton.gif HTTP/1.1\r\n ....\r\n ....\r\n ....\r\n ....\r\n \r\n 注意http协议头部分最后要加入\r\n表示协议头的结束
外网ping不通,但是可以通过浏览器访问呀,这是怎么回事呢。
了解了,谢谢。在网上查了一下,整个过程可以简单描述为:其实就是先与代理服务器连接,然后向代理服务器发送Http请求就可以了,代理服务器会将请求转发给外网服务器。不知道是不是这样呢?
14 365 ms 374 ms 369 ms otecbb103.kddnet.ad.jp [124.211.33.65]
15 347 ms 353 ms 358 ms otejbb203.kddnet.ad.jp [59.128.4.61]
16 360 ms 360 ms 432 ms cm-ote231.kddnet.ad.jp [118.155.197.12]
17 365 ms 372 ms 375 ms 125.29.25.162
18 234 ms 249 ms 223 ms rt-core01-ge-1-10.dnp.ad.jp [210.133.110.38]
19 250 ms 245 ms 246 ms sw-cust101-ge-0-1.dnp.ad.jp [210.133.110.90]
20 * * * Request timed out.
21 * * * Request timed out.
22 * * * Request timed out.估计210.133.110.90机房的放火墙做了限制。禁止ping、所以ping不通了
<HTML><HEAD>
<TITLE>501 Method Not Implemented</TITLE>
</HEAD><BODY>
<H1>Method Not Implemented</H1>
xxx to /index.html not supported.<P>
Invalid method in request \x80<P>
<HR>
<ADDRESS>Apache/1.3.37 Server at 127.0.0.1 Port 80</ADDRESS>我用我的程序测试过,你可以的,你的程序还是有问题。
这位大哥,我现在用代理也连通了,就是直接向210.133.109.190发送Http请求,服务器可以返回内容,只是返回的有问题,能不能帮我看看。返回内容是:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /cgi-bin/msrs/getvics.cgi was not found on this server.</p>
</body></html>我发送HTTP请求的代码如下:
strcat(m_cRequestHeader, "POST ");
strcat(m_cRequestHeader, "/cgi-bin/msrs/getvics.cgi");
strcat(m_cRequestHeader, " HTTP/1.1");
strcat(m_cRequestHeader, "\r\n"); strcat(m_cRequestHeader, "Content-Type: text/xml; charset=UTF-8\r\n"); strcat(m_cRequestHeader, "Accept: */*\r\n"); strcat(m_cRequestHeader, "Connection: Keep-Alive\r\n"); strcat(m_cRequestHeader, "User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)\r\n"); strcat(m_cRequestHeader, "x-protocol-version:1.0\r\n"); //host name
strcat(m_cRequestHeader, "Host:");
strcat(m_cRequestHeader, "210.133.109.190");
strcat(m_cRequestHeader,":");
strcat(m_cRequestHeader, "80");
strcat(m_cRequestHeader, "\r\n");以上的Http请求有什么问题吗?这个URL应该是没有问题的,因为用浏览器访问是可以的,URL如下:http://210.133.109.190/cgi-bin/msrs/getvics.cgi
GET /PointForum/ui/styles/default/topic/bgButton.gif HTTP/1.1\r\n
....\r\n
....\r\n
....\r\n
....\r\n
\r\n
注意http协议头部分最后要加入\r\n表示协议头的结束