An example of using pycurl to upload a header

Source: Internet
Author: User

#! /Usr/bin/Python

Import pycurl

Import socket

Import time


Def work_socket ():

S = socket. socket (socket. af_inet, socket. sock_stream)

S. setsockopt (socket. sol_socket, socket. so_reuseaddr, 1)

S. BIND ('10. 67.15.96 ', 9999 ))

S. Listen (10)

S. setblocking (0)

S. setTimeout (10)

Conn, ADDR = S. Accept ()

Conn. Send ('10. 67.15.96 ')




If _ name _ = '_ main __':

Common_list = ['10. 67.15.22 ', '10. 67.15.24', '10. 67.15.25 ', '10. 67.15.48']

Bigapp_list = ['10. 67.15.39 ', '10. 67.15.65', '10. 67.15.66 ', '10. 67.15.27']

Ent_list = ['10. 67.15.23 ', '10. 67.15.42', '10. 67.15.43 ', '10. 67.15.67', '10. 67.15.68 ', '10. 67.15.69']

C = pycurl. Curl ()

For IA in scope (100 ):

For I in common_list:

C. setopt (C. httpheader, ["Host: Taobao", "appname: monitorcommon1", "appversion: 3", "apphash: 604", "accesskey: 2ynwm3xxlm", "secretkey: lwz24

Success "," mcip: 1 default; 1 ::; 1 :@ default :;; "," mysqlport: 3307 "," appcookie: AKs = 4j33x1wm2n, 5020k300z0, 5m0lw4l3zl, o4550jjym3, o1n5kwmyx0, 3 ozlxl

O0jy, k40z12j23x, yyl3jxzj3x, kxjyl3llyy, looz04o3my, region, z2wlx21240, region, noyj200ml0; DEBUG = 1 "])

C. setopt (C. url, '% S/monitor.html' % I)

C. Perform ()

For II in bigapp_list:

C. setopt (C. httpheader, ["Host: monitorbigapp1.sinaapp.com", "appname: monitorbigapp1", "appversion: 3", "apphash: 953", "accesskey: 0y34wm3zlz", "secretkey

: Success "," mcip: 1 default; 1 ::; 1 :@ default :;; "," mysqlport: 3307 "," appcookie: AKs = 4j33x1wm2n, 5020k300z0, 5m0lw4l3zl, o4550jjym3, o1n5kwm

Yx0, 3ozlxlo0jy, k40z12j23x, yyl3jxzj3x, large, looz04o3my, large, z2wlx21240, large, noyj200ml0; DEBUG = 1 "])

C. setopt (C. url, '% S/monitor.html' % II)

C. Perform ()

For III in ent_list:

C. setopt (C. httpheader, ["Host: monitorent1.sinaapp.com", "appname: monitorent1", "appversion: 3", "apphash: 156", "accesskey: 3lyw2wky00", "secretkey: l

Success "," mcip: 1 default; 1 ::; 1 :@ default :;; "," mysqlport: 3307 "," appcookie: AKs = 4j33x1wm2n, 5020k300z0, 5m0lw4l3zl, o4550jjym3, o1n5kwmyx0

, 3ozlxlo0jy, k40z12j23x, yyl3jxzj3x, kxjyl3llyy, looz04o3my, role, z2wlx21240, role, noyj200ml0; DEBUG = 1 "])

C. setopt (C. url, '% S/monitor.html' % III)

C. Perform ()

Time. Sleep (5)


This article is from the "batch CT Batch Data Synchronization" blog, please be sure to keep this source http://4249964.blog.51cto.com/4239964/1559298

An example of using pycurl to upload a header

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.