antcdp

package
v0.0.0-...-6c7a55c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package antcdp is an experimental package that implements an `ant.Client` that performs HTTP requests using chrome and returns a rendered response.

Usage:

eng, err := ant.NewEngine(ant.EngineConfig{
  Fetcher: &ant.Fetcher{
    Client: &antcdp.Client{},
  }
})

Index

Constants

View Source
const (
	// Addr is the default address to connect to.
	//
	// It is used if `Client.Addr` is empty.
	Addr = "http://127.0.0.1:9222"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Addr is the address to connect to.
	//
	// If empty, it defaults to `antcdp.Addr`.
	Addr string
	// contains filtered or unexported fields
}

Client implements a chrome debugger protocol client.

The client is similar to the default net/http.Client it receives http.Request translates it to CDP commands and returns an http.Response.

Its zero-value is ready for use and connects to a CDP server locally at `127.0.0.1:9222`.

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

Do implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL