cclient

package module
v0.0.0-...-9880495 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 3 Imported by: 1

README

cclient adapter

This example contains a cclient package which implements an adapter for cclient.

Usage

package main

import (
	tls "github.com/refraction-networking/utls"
	"github.com/sleeyax/gotcha"
	"github.com/sleeyax/gotcha/adapters/cclient"
)

func main() {
	adapter := cclient.NewAdapter(tls.HelloChrome_Auto)
	
	client, _ := gotcha.NewClient(&gotcha.Options{
		Adapter: adapter,
	})
	resp, err := client.Get("https://example.com")
	// ...

	// change TLS client hello ID at runtime
	adapter.ClientHello = tls.HelloFirefox_Auto
	resp, err = client.Get("https://example.com")
	// ...
}

Test

$ go test ./cclient
$ go run ./main.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {

	// TLS client hello ID to use.
	ClientHello tls.ClientHelloID
	// contains filtered or unexported fields
}

func NewAdapter

func NewAdapter(clientHello tls.ClientHelloID, proxyUrl ...string) *Adapter

func (*Adapter) DoRequest

func (a *Adapter) DoRequest(options *gotcha.Options) (*gotcha.Response, error)

Jump to

Keyboard shortcuts

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