aardio 官方社区

 找回密码
 注册会员

QQ登录

只需一步,快速开始

搜索
查看: 11427|回复: 2

请问:whttp如何使用代理呢?

[复制链接]

1

主题

8

回帖

49

积分

新手入门

积分
49
发表于 2011-10-8 16:46:01 | 显示全部楼层 |阅读模式
http代理如下
import console
import inet.http
http=inet.http()
import inet
http.flags = 0x80000000
/*_INTERNET_FLAG_RELOAD*/
inet.setProxy(
"122.70.137.12:808",,http.session);
html=http.get(
"http://www.ip138.com/ip2city.asp")
console.log(html)

whttp,该如何设置呢?


import console
import inet.whttp
whttp=inet.whttp()
import inet
inet.setProxy(
"122.70.137.12:808",,whttp.session);
html=whttp.get(
"http://www.ip138.com/ip2city.asp")
console.log(html)
跟http不一样么?

56

主题

412

回帖

3788

积分

荣誉会员

积分
3788
发表于 2011-10-13 19:50:38 | 显示全部楼层
设置代理可以直接在 构造函数得形参设置,如下


import console
fun=function(ip){
   
import inet.whttp
    whttp=inet.whttp(,ip)
   
import inet
    html=whttp.get(
"http://www.ip138.com/ip2city.asp")
    console.log(html)
}
thread.create(fun,
"122.70.137.12:808")




可以查看  inet里面得whttp 库,如下句子

whttp = class{
        
   
ctor( agent = "Mozilla/4.0", proxy,proxyBypass=""){

ctor 就可以看做是 函数得 形参,即是第二个 proxy

whttp=inet.whttp(,ip)

就直接设置代理IP了




http 同理


0

主题

10

回帖

52

积分

一级会员

积分
52
发表于 2013-2-18 16:42:19 | 显示全部楼层
http 同理
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

手机版|未经许可严禁引用或转载本站文章|aardio.com|aardio 官方社区 ( 皖ICP备09012014号 )

GMT+8, 2025-2-10 17:33 , Processed in 0.058174 second(s), 22 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表