Package Halberd :: Module clientlib
[hide private]
[frames] | no frames]

Module clientlib

source code

HTTP/HTTPS client module.

Classes [hide private]
  HTTPError
Generic HTTP exception
  HTTPSError
Generic HTTPS exception
  InvalidURL
Invalid or unsupported URL
  TimedOut
Operation timed out
  ConnectionRefused
Unable to reach webserver
  UnknownReply
The remote host didn't return an HTTP reply
  HTTPClient
Special-purpose HTTP client.
  HTTPSClient
Special-purpose HTTPS client.
Functions [hide private]
class
clientFactory(scantask)
HTTP/HTTPS client factory.
source code
Variables [hide private]
float default_timeout = 2
Default timeout for socket operations.
int default_bufsize = 1024
Default number of bytes to try to read from the network.
str default_template = 'GET %(request)s HTTP/1.1\r\nHost: %(hostna...
Request template, must be filled by HTTPClient
  __package__ = 'Halberd'
Function Details [hide private]

clientFactory(scantask)

source code 

HTTP/HTTPS client factory.

Parameters:
  • scantask (instanceof(ScanTask)) - Object describing where the target is and how to reach it.
Returns: class
The appropriate client class for the specified URL.

Variables Details [hide private]

default_template

Request template, must be filled by HTTPClient
Type:
str
Value:
'''GET %(request)s HTTP/1.1\r
Host: %(hostname)s%(port)s\r
Pragma: no-cache\r
Cache-control: no-cache\r
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20\
050414 Firefox/1.0.3\r
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, applicati\
on/x-shockwave-flash, */*\r
...