Skip to content
/ rawhttp Public

A mininal go http client for security testing

Notifications You must be signed in to change notification settings

zema1/rawhttp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7b9cd02 · Feb 14, 2025

History

12 Commits
Aug 22, 2023
Aug 22, 2023
Nov 2, 2022
Aug 22, 2023
Feb 13, 2025
Aug 22, 2023
Feb 13, 2025
Aug 22, 2023
Aug 22, 2023
Aug 22, 2023
Feb 13, 2025
Aug 22, 2023

Repository files navigation

rawhttp

A minimal http client for testing.

No connection pool, no fixes for RFC.

Modified from https://github.com/projectdiscovery/rawhttp

package main

import (
	"fmt"
	"github.com/zema1/rawhttp"
	"io/ioutil"
	"net/http"
	"time"
)

func main() {
	options := &rawhttp.Options{
		Timeout:                0 * time.Second,
		FollowRedirects:        false,
		MaxRedirects:           0,
		AutomaticHostHeader:    true,
		AutomaticContentLength: false,
		ForceReadAllBody:       false,
	}
	client := rawhttp.NewClient(options)
	req, _ := http.NewRequest(http.MethodGet, "https://example.com", nil)
	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	data, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(string(data))
}

About

A mininal go http client for security testing

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages