已经找到“” 的记录296条
隧道代理(固定时长)python语言代码示例
  1. import base64
  2. import time
  3. import requests
  4. from requests.adapters import HTTPAdapter
  5. auth_key = "请改成您的Key"
  6. password = "请改成您的AuthPwd"
  7. tunnel_server = "http://请改成您的隧道地址" # 如:tunnel3.qg.net:19263
  8. target_url = "https://ip.cn/api/index?ip=&type=0" # 要访问的目标地址
  9. proxy_headers = {}
  10. proxy = {
  11. "http": tunnel_server,
  12. "https": tunnel_server
  13. }
  14. def encode_authorization(key, passwd):
  15. # python 使用 bytes 类型进行 base64 编码
  16. basic_str = bytes("%s:%s" % (key, passwd), "ascii")
  17. # 得到的返回值也是 bytes 类型,所以需要再 decode 为字符串
  18. return "Basic %s" % base64.b64encode(basic_str).decode("utf-8")
  19. def reset_tunnel_proxy_headers():
  20. global proxy_headers
  21. proxy_headers = {
  22. tunnel_server: {
  23. "Proxy-Authorization": encode_authorization(auth_key, password)
  24. }
  25. }
  26. def update_tunnel_proxy_headers(key, val):
  27. global proxy_headers
  28. proxy_headers[tunnel_server][key] = val
  29. def new_session():
  30. adapter = TunnelProxyAdapter()
  31. se = requests.Session()
  32. se.mount('https://', adapter)
  33. se.mount('http://', adapter)
  34. return se
  35. class TunnelProxyAdapter(requests.adapters.HTTPAdapter):
  36. def proxy_headers(self, p):
  37. if p in proxy_headers:
  38. print("session with headers:", proxy_headers[p])
  39. return proxy_headers[p]
  40. else:
  41. return None
  42. def multi_channel_tunnel():
  43. """
  44. 结果类似:
  45. request on multi channel
  46. request id: 1 , channel id: channel-1, code: 200, result: 183.155.88.224
  47. request id: 2 , channel id: channel-2, code: 200, result: 125.112.38.153
  48. request id: 3 , channel id: channel-3, code: 200, result: 183.155.89.125
  49. request id: 4 , channel id: channel-4, code: 200, result: 49.71.121.169
  50. request id: 5 , channel id: channel-5, code: 200, result: 115.210.67.220
  51. request id: 6 , channel id: channel-6, code: 200, result: 36.25.41.178
  52. request id: 7 , channel id: channel-7, code: 200, result: 180.125.162.116
  53. request id: 8 , channel id: channel-8, code: 200, result: 140.250.150.158
  54. request id: 9 , channel id: channel-9, code: 200, result: 121.227.102.227
  55. request id: 10, channel id: channel-10, code: 200, result: 49.88.106.198
  56. request id: 1 , channel id: channel-1, code: 200, result: 183.155.88.224
  57. request id: 2 , channel id: channel-2, code: 200, result: 125.112.38.153
  58. request id: 3 , channel id: channel-3, code: 200, result: 183.155.89.125
  59. request id: 4 , channel id: channel-4, code: 200, result: 49.71.121.169
  60. request id: 5 , channel id: channel-5, code: 200, result: 115.210.67.220
  61. request id: 6 , channel id: channel-6, code: 200, result: 36.25.41.178
  62. request id: 7 , channel id: channel-7, code: 200, result: 180.125.162.116
  63. request id: 8 , channel id: channel-8, code: 200, result: 140.250.150.158
  64. request id: 9 , channel id: channel-9, code: 200, result: 121.227.102.227
  65. request id: 10, channel id: channel-10, code: 200, result: 49.88.106.198
  66. """
  67. print("request on multi channel")
  68. reset_tunnel_proxy_headers()
  69. for i in range(1, 11):
  70. se = new_session()
  71. chan_id = "channel-%s" % i
  72. update_tunnel_proxy_headers("Proxy-TunnelID", chan_id)
  73. resp = se.get(target_url, proxies=proxy, headers={"Connection": "close"})
  74. print("request id: %-2s, channel id: %s, code: %s, result: %s" % (i, chan_id, resp.status_code, resp.text))
  75. time.sleep(10)
  76. # 因为固定时长为1分钟,所以在1分钟内继续使用已有通道,仍是之前的IP
  77. for i in range(1, 11):
  78. se = new_session()
  79. chan_id = "channel-%s" % i
  80. update_tunnel_proxy_headers("Proxy-TunnelID", chan_id)
  81. resp = se.get(target_url, proxies=proxy, headers={"Connection": "close"})
  82. print("request id: %-2s, channel id: %s, code: %s, result: %s" % (i, chan_id, resp.status_code, resp.text))
  83. if __name__ == "__main__":
  84. multi_channel_tunnel()
隧道代理(固定时长)Go语言代码示例
  1. package main
  2. import (
  3. "fmt"
  4. "io/ioutil"
  5. "net/http"
  6. "net/url"
  7. "sync"
  8. "time"
  9. )
  10. /** 返回内容
  11. 第一次循环
  12. 当前 IP:121.230.91.188 来自于:中国 江苏 泰州 电信
  13. 当前 IP:60.184.205.115 来自于:中国 浙江 丽水 电信
  14. 当前 IP:125.112.205.149 来自于:中国 浙江 金华 电信
  15. 当前 IP:60.184.108.175 来自于:中国 浙江 丽水 电信
  16. 当前 IP:58.214.87.31 来自于:中国 江苏 无锡 电信
  17. 当前 IP:183.143.131.24 来自于:中国 浙江 湖州 电信
  18. 当前 IP:42.53.99.119 来自于:中国 辽宁 锦州 联通
  19. 当前 IP:59.60.142.70 来自于:中国 福建 漳州 电信
  20. 当前 IP:114.226.175.159 来自于:中国 江苏 常州 电信
  21. 当前 IP:123.162.194.223 来自于:中国 河南 驻马店 电信
  22. max channel reached
  23. 第二次循环
  24. 当前 IP:114.226.175.159 来自于:中国 江苏 常州 电信
  25. 当前 IP:60.184.205.115 来自于:中国 浙江 丽水 电信
  26. 当前 IP:121.230.91.188 来自于:中国 江苏 泰州 电信
  27. 当前 IP:125.112.205.149 来自于:中国 浙江 金华 电信
  28. 当前 IP:123.162.194.223 来自于:中国 河南 驻马店 电信
  29. 当前 IP:58.214.87.31 来自于:中国 江苏 无锡 电信
  30. 当前 IP:183.143.131.24 来自于:中国 浙江 湖州 电信
  31. 当前 IP:60.184.108.175 来自于:中国 浙江 丽水 电信
  32. 当前 IP:59.60.142.70 来自于:中国 福建 漳州 电信
  33. 当前 IP:42.53.99.119 来自于:中国 辽宁 锦州 联通
  34. 第二次循环返回的IP与第一次循环相同,因为goroutine是异步的,所以返回顺序和第一次不一致
  35. myip.ipip.net服务器可能比较容易失败,用户可以自己找一个其他获取客户端IP的服务器来测试
  36. */
  37. // 固定时长多通道隧道模式
  38. func main() {
  39. authKey := "请改成您的Key" //固定时长1分钟的隧道,通道数10
  40. password := "请改成您的AuthPwd"
  41. proxyServer := "请改成您的隧道地址" //如:tunnel3.qg.net:19263
  42. targetURL := "https://ip.cn/api/index?ip=&type=0"
  43. rawURL := fmt.Sprintf("http://%s:%s@%s", authKey, password, proxyServer)
  44. proxyUrl, _ := url.Parse(rawURL)
  45. wg := sync.WaitGroup{}
  46. wg.Add(11)
  47. // 十个通道分别使用不同的十个IP,第十一次会返回错误,通道数超出
  48. for i := 0; i < 11; i++ {
  49. go func(index int) {
  50. defer wg.Done()
  51. client := http.Client{
  52. Transport: &http.Transport{
  53. ProxyConnectHeader: http.Header{
  54. "Proxy-TunnelID": []string{fmt.Sprintf("channel-%d", index)}, // 指定通道ID
  55. },
  56. Proxy: http.ProxyURL(proxyUrl),
  57. },
  58. }
  59. req, _ := http.NewRequest("GET", targetURL, nil)
  60. rsp, err := client.Do(req)
  61. if err != nil {
  62. fmt.Printf("request failed: %s\n", err)
  63. return
  64. }
  65. defer rsp.Body.Close()
  66. body, err := ioutil.ReadAll(rsp.Body)
  67. if err != nil {
  68. fmt.Println(err)
  69. } else {
  70. fmt.Println(string(body))
  71. }
  72. }(i)
  73. }
  74. wg.Wait()
  75. // 因为固定时长为1分钟,所以在1分钟内继续使用已有通道,仍是之前的IP
  76. time.Sleep(time.Second * 10)
  77. wg.Add(10)
  78. for i := 0; i < 10; i++ {
  79. go func(index int) {
  80. defer wg.Done()
  81. client := http.Client{
  82. Transport: &http.Transport{
  83. ProxyConnectHeader: http.Header{
  84. "Proxy-TunnelID": []string{fmt.Sprintf("channel-%d", index)}, // 指定通道ID
  85. },
  86. Proxy: http.ProxyURL(proxyUrl),
  87. },
  88. }
  89. req, _ := http.NewRequest("GET", targetURL, nil)
  90. rsp, err := client.Do(req)
  91. if err != nil {
  92. fmt.Printf("request failed: %s\n", err)
  93. return
  94. }
  95. defer rsp.Body.Close()
  96. body, err := ioutil.ReadAll(rsp.Body)
  97. if err != nil {
  98. fmt.Println(err)
  99. } else {
  100. fmt.Println(string(body))
  101. }
  102. }(i)
  103. }
  104. wg.Wait()
  105. }
隧道代理(动态请求)python语言代码示例

普通模式

  1. import requests
  2. targetURL = "https://ip.cn/api/index?ip=&type=0" //要访问的目标地址
  3. proxyAddr = "请改成您的隧道地址" //如:tunnel3.qg.net:19263
  4. authKey = "请改成您的Key"
  5. password = "请改成您的AuthPwd"
  6. # 账密模式
  7. proxyUrl = "http://%(user)s:%(password)s@%(server)s" % {
  8. "user": authKey,
  9. "password": password,
  10. "server": proxyAddr,
  11. }
  12. proxies = {
  13. "http": proxyUrl,
  14. "https": proxyUrl,
  15. }
  16. for i in range(10):
  17. resp = requests.get(targetURL, proxies=proxies)
  18. print(resp.text)

打标记模式

  1. import base64
  2. import time
  3. import requests
  4. from requests.adapters import HTTPAdapter
  5. auth_key = "请改成您的Key"
  6. password = "请改成您的AuthPwd"
  7. tunnel_server = "http://请改成您的隧道地址" //如:tunnel3.qg.net:19263
  8. target_url = "https://ip.cn/api/index?ip=&type=0" // 要访问的目标地址
  9. proxy_headers = {}
  10. proxy = {
  11. "http": tunnel_server,
  12. "https": tunnel_server
  13. }
  14. def encode_authorization(key, passwd):
  15. # python 使用 bytes 类型进行 base64 编码
  16. basic_str = bytes("%s:%s" % (key, passwd), "ascii")
  17. # 得到的返回值也是 bytes 类型,所以需要再 decode 为字符串
  18. return "Basic %s" % base64.b64encode(basic_str).decode("utf-8")
  19. def reset_tunnel_proxy_headers():
  20. global proxy_headers
  21. proxy_headers = {
  22. tunnel_server: {
  23. "Proxy-Authorization": encode_authorization(auth_key, password)
  24. }
  25. }
  26. def update_tunnel_proxy_headers(key, val):
  27. global proxy_headers
  28. proxy_headers[tunnel_server][key] = val
  29. def new_session():
  30. adapter = TunnelProxyAdapter()
  31. se = requests.Session()
  32. se.mount('https://', adapter)
  33. se.mount('http://', adapter)
  34. return se
  35. class TunnelProxyAdapter(requests.adapters.HTTPAdapter):
  36. def proxy_headers(self, p):
  37. if p in proxy_headers:
  38. print("session with headers:", proxy_headers[p])
  39. return proxy_headers[p]
  40. else:
  41. return None
  42. def normal_tunnel():
  43. """
  44. 结果类似:
  45. request on normal mode
  46. session with headers: {'Proxy-Authorization': 'Basic xxxx'}
  47. request id: 1, code: 200, result: 140.250.149.229
  48. """
  49. reset_tunnel_proxy_headers()
  50. print("request on normal mode")
  51. resp = new_session().get(target_url, proxies=proxy)
  52. print("request id: 1, code: %s, result: %s" % (resp.status_code, resp.text))
  53. def mark_tunnel():
  54. """
  55. 结果类似:
  56. request with mark
  57. session with headers: {'Proxy-Authorization': 'Basic xxxx', 'Proxy-TunnelID': 'channel-1', 'Proxy-TTL': 10}
  58. request id: 1 , code: 200, result: 183.166.118.48
  59. request id: 2 , code: 200, result: 183.166.118.48
  60. request id: 3 , code: 200, result: 183.166.118.48
  61. request id: 4 , code: 200, result: 183.166.118.48
  62. request id: 5 , code: 200, result: 183.166.118.48
  63. request id: 6 , code: 200, result: 183.166.118.48
  64. request id: 7 , code: 200, result: 183.142.59.203
  65. request id: 8 , code: 200, result: 183.142.59.203
  66. request id: 9 , code: 200, result: 183.142.59.203
  67. request id: 10, code: 200, result: 123.54.235.89
  68. """
  69. reset_tunnel_proxy_headers()
  70. update_tunnel_proxy_headers("Proxy-TunnelID", "channel-1")
  71. update_tunnel_proxy_headers("Proxy-TTL", 10)
  72. se = new_session()
  73. print("request with mark")
  74. for i in range(1, 12):
  75. resp = se.get(target_url, proxies=proxy, headers={"Connection": "close"})
  76. print("request id: %-2s, code: %s, result: %s" % (i, resp.status_code, resp.text))
  77. time.sleep(1)
  78. if __name__ == "__main__":
  79. normal_tunnel()
  80. mark_tunnel()
 
隧道代理(动态请求)Go语言代码示例

普通模式

  1. package main
  2. import (
  3. "fmt"
  4. "io/ioutil"
  5. "net/http"
  6. "net/url"
  7. "sync"
  8. "time"
  9. )
  10. func main() {
  11. authKey := "请改成您的Key"
  12. password := "请改成您的AuthPwd"
  13. proxyServer := "请改成您的隧道地址" //如:tunnel3.qg.net:19263
  14. targetURL := "https://ip.cn/api/index?ip=&type=0"
  15. rawURL := fmt.Sprintf("http://%s:%s@%s", authKey, password, proxyServer)
  16. proxyUrl, _ := url.Parse(rawURL)
  17. client := http.Client{
  18. Transport: &http.Transport{
  19. Proxy: http.ProxyURL(proxyUrl),
  20. },
  21. }
  22. req, _ := http.NewRequest("GET", targetURL, nil)
  23. rsp, err := client.Do(req)
  24. if err != nil {
  25. fmt.Printf("request failed: %s\n", err)
  26. return
  27. }
  28. defer rsp.Body.Close()
  29. body, err := ioutil.ReadAll(rsp.Body)
  30. if err != nil {
  31. fmt.Println(err)
  32. } else {
  33. fmt.Println(string(body))
  34. }
  35. }

打标记模式

  1. package main
  2. import (
  3. "fmt"
  4. "io/ioutil"
  5. "net/http"
  6. "net/url"
  7. "sync"
  8. "time"
  9. )
  10. /** 返回内容
  11. 当前 IP:114.219.115.191 来自于:中国 江苏 苏州 电信
  12. 当前 IP:114.219.115.191 来自于:中国 江苏 苏州 电信
  13. 当前 IP:114.219.115.191 来自于:中国 江苏 苏州 电信
  14. 当前 IP:114.219.115.191 来自于:中国 江苏 苏州 电信
  15. 当前 IP:114.219.115.191 来自于:中国 江苏 苏州 电信
  16. 当前 IP:114.219.115.191 来自于:中国 江苏 苏州 电信
  17. 当前 IP:114.219.115.191 来自于:中国 江苏 苏州 电信
  18. 当前 IP:114.219.115.191 来自于:中国 江苏 苏州 电信
  19. 当前 IP:114.219.115.191 来自于:中国 江苏 苏州 电信
  20. 当前 IP:114.219.115.191 来自于:中国 江苏 苏州 电信
  21. 当前 IP:14.118.211.116 来自于:中国 广东 江门 电信
  22. */
  23. func main() {
  24. authKey := "请改成您的Key"
  25. password := "请改成您的AuthPwd"
  26. proxyServer := "请改成您的隧道的地址" //如:tunnel3.qg.net:19263
  27. targetURL := "https://ip.cn/api/index?ip=&type=0"
  28. rawURL := fmt.Sprintf("http://%s:%s@%s", authKey, password, proxyServer)
  29. proxyUrl, _ := url.Parse(rawURL)
  30. client := http.Client{
  31. Transport: &http.Transport{
  32. ProxyConnectHeader: http.Header{
  33. "Proxy-TunnelID": []string{"channel-1"}, // 在CONNECT连接中新增Proxy-TunnelID打标记
  34. "Proxy-TTL": []string{"10"}, // Proxy-TTL指定该标记IP的存活时间
  35. },
  36. Proxy: http.ProxyURL(proxyUrl),
  37. },
  38. }
  39. // 因为标记的存活时间是10s,所以循环11次中有10次的IP是一样的。
  40. // 第11次因为标记的IP到期了,系统会自动替换IP
  41. wg := sync.WaitGroup{}
  42. wg.Add(11)
  43. for i := 0; i < 11; i++ {
  44. go func() {
  45. defer wg.Done()
  46. req, _ := http.NewRequest("GET", targetURL, nil)
  47. rsp, err := client.Do(req)
  48. if err != nil {
  49. fmt.Printf("request failed: %s\n", err)
  50. return
  51. }
  52. defer rsp.Body.Close()
  53. body, err := ioutil.ReadAll(rsp.Body)
  54. if err != nil {
  55. fmt.Println(err)
  56. } else {
  57. fmt.Println(string(body))
  58. }
  59. }()
  60. time.Sleep(time.Second)
  61. }
  62. wg.Wait()
  63. }
 
CentOS7.6的yum更换为国内的阿里云yum源

1.备份原有的yum

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2.下载新的CentOS-Base.repo /etc/yum.repos.d/

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3.添加EPEL

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

4.清理缓存并生成新的缓存

yum clean all

yum makecache

5.这样就安装完成了

MAC如何远程windows桌面

1.首先在APPSTOR下载“Microsoft Remote Desktop”应用

2.在打开的“Microsoft Remote Desktop”窗口中,单击“New”图标按钮,来创建一个新的远程主机

3.根据图片上得文字描述,输入需要连接的用户名密码,和ip地址。

PC Name:这里输入你要连接的远程计算机IP地址

UserName:平时登录计算机的用户名

Password:登录计算机的密码

输入以上信息后,直接关闭窗口就可以了,系统会自动保存

4.新建远程计算机后,在列表内就会出现了,您只需要双击就可以连接了

6.当您双击列表开始连接后,正常就会看到这个提示框了,单击“Continue”继续就可以了

7.Yes,已经成功连接至Windows系统了

Windows7系统如何解决宽带连接提示错误692问题

Windows 7系统下如何解决宽带连接提示错误692问题呢?

出现此错误提示可能是频繁拨号导致,此时需要重启下系统。打开“运行”,输入shutdown -r -t 0,然后点击“确定”即可重启。重启后即可恢复

飞网关于2022年五一放假通知

尊敬的飞网客户:

2022年五一即将到来,飞网祝您节日快乐,合家辛福!

飞网五一放假安排如下:

2022年4月30日至5月4日放假调休,共5天。5月5日正常上班。

假期如果您想购买我们产品,请直接在网站上在线支付购买,目前网站支持支付宝等在线支付方式,在线支付的客户全部是即时到帐,直接在线购买开通。

  如果您是银行付款,请付款后电话至4007-567-365,财务会在10分种内给您处理好。

  售后服务方面,假期您的售后服务专员QQ可能不在线,如有急事打公司值班手机18936527027,我们会在10分钟内为您提供所要的服务。

    顺祝商祺!

江苏山阳网络科技有限公司
2022年4月28日

来自:新闻公告
上新通知:山东日照联通,四川省达州联通上新通知

山东日照联通已上新,请需要的速度采购

https://www.fwvps.com/business/s9q/sdrzlt.html

 

 

四川省达州联通

 

https://www.fwvps.com/business/s9q/scsdzlt.html

 

 

2022-6-1

来自:新闻公告
Windwos7设置多用户同时连接远程桌面

1.打开“运行”,输入gpedit.msc,打开本地组策略编辑器

2.按计算机配置管理模板Windows组件远程桌面服务远程桌面会话主机连接,进入到如图所示界面

3.双击“限制连接的数量”

4.点选“已启用”,在“允许的RD最大连接数”设置为999999,然后点击“确定”

5.双击“将远程桌面服务用户限制到单独的远程桌面服务会话”

6.点选“已禁用”,然后点击“确定”即可

7.安装UniversalTermsrvPatch补丁破解远程功能限制

UniversalTermsrvPatch补丁复制到机器中,右键“以管理员身份运行”

开启UniversalTermsrvPatch后,点击“破解”

提示Patch Success(成功),确认重启机器即可。

客户热线:4007-567-365

客户服务中心
点击联系微信客服