module Browser: sig
.. end
A simple web browser.
This simulates an HTTP browser, ie it can get pages (with all dependancies
but without javascript execution of course), then return a list of available
links from this page, and a dom-like representation so that the programmer can
easily extract some informations (such as session ids) to forge next gets of
a test plan (or use regex on content?).
val debug : bool
Browser
type
cookie = {
|
name : string ; |
|
value : string ; |
|
domain : string ; |
|
path : string ; |
}
type
vacant_cnx = {
}
type
t = {
|
host : Host.host_trx ; |
|
user_agent : string ; |
|
mutable cookies : cookie list ; |
|
mutable vacant_cnxs : (Host.addr * Tcp.Port.t, vacant_cnx) Batteries.Hashtbl.t ; |
|
max_vacant_cnx : int ; |
|
max_idle_cnx : Clock.Interval.t ; |
}
A browser is build from a host, and has a set of cookies and of connections.
val make : ?user_agent:string ->
?max_vacant_cnx:int ->
?max_idle_cnx:Clock.Interval.t -> Host.host_trx -> t
Cookies
Cookies (as of RFC 6265).
Note: all our cookies are "session cookies", ie we keep them only in the browser memory.
val string_of_cookie : cookie -> string
val domain_matches : string -> string -> bool
val path_matches : string -> string -> bool
val parse_cookie : string -> string -> string -> cookie option
val cookie_dirname : string -> string
val store_cookies : t -> string -> string -> (Batteries.String.t * string) list -> unit
val cookies_to_sent : t -> string -> string -> cookie list
val cookie_string : t -> string -> string -> string
val message_get : Metric.Timed.t
val per_status : (Http.code, Metric.Atomic.t) Batteries.Hashtbl.t
val find_vacant_cnx : t -> Host.addr -> Tcp.Port.t -> vacant_cnx option
val clean_vacant_cnxs : t -> unit
val make_vacant_cnx : t ->
Tcp.TRX.tcp_trx -> Http.TRXtop.t -> Host.addr -> Tcp.Port.t -> unit
val request : t ->
?command:string ->
?headers:Http.header list ->
?body:string -> Url.t -> ((Http.header list * string) option -> unit) -> unit
val get : t ->
?headers:Http.header list ->
Url.t -> ((Http.header list * string) option -> unit) -> unit
val post : t ->
?headers:Http.header list ->
Url.t ->
(string * string) list ->
((Http.header list * string) option -> unit) -> unit
val spider : t -> int -> Url.t -> unit
val user : t -> ?pause:float -> int -> Url.t -> unit
module Plan: sig
.. end