All Projects → projectdiscovery → rawhttp

projectdiscovery / rawhttp

Licence: MIT license
Raw HTTP client in Go for complete request control and customization.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to rawhttp

Expynent
A library that provides regular expression patterns. If you hate to write regular expressions, then expynent can help you.
Stars: ✭ 350 (+250%)
Mutual labels:  lib
Imageselector
图片选择器, 支持多图选择和图片预览
Stars: ✭ 62 (-38%)
Mutual labels:  lib
Notion Js
🤯 Notion API
Stars: ✭ 136 (+36%)
Mutual labels:  lib
Bounty
Javascript and SVG odometer effect library with motion blur
Stars: ✭ 724 (+624%)
Mutual labels:  lib
Xtd forms
Modern c++17 library to create native gui for Microsoft Windows, Apple macOS and Linux.
Stars: ✭ 25 (-75%)
Mutual labels:  lib
Yamaha Nodejs
A node module to control your yamaha receiver
Stars: ✭ 103 (+3%)
Mutual labels:  lib
Libmqtt
MQTT v3.1.1/5.0 library in Go
Stars: ✭ 290 (+190%)
Mutual labels:  lib
Stdlib
✨ Standard library for JavaScript and Node.js. ✨
Stars: ✭ 2,749 (+2649%)
Mutual labels:  lib
Easygo
基于Kotlin、OkHttp的声明式网络框架,像写HTML界面一样写网络调用代码
Stars: ✭ 40 (-60%)
Mutual labels:  lib
Vue Loaders
Vue + loaders.css
Stars: ✭ 127 (+27%)
Mutual labels:  lib
Android Hot Libraries
收集总结 Android 项目中值得推荐的优秀开源项目
Stars: ✭ 755 (+655%)
Mutual labels:  lib
Node Pretty Exceptions
Pretty and more helpful uncaught exceptions, automatically
Stars: ✭ 22 (-78%)
Mutual labels:  lib
Dtkwidget
Deepin Toolkit, widget module for DDE look and feel
Stars: ✭ 112 (+12%)
Mutual labels:  lib
Nintendo Switch Eshop
Crawler for Nintendo Switch eShop
Stars: ✭ 463 (+363%)
Mutual labels:  lib
React Scoped Css
CSS encapsulation solution for React
Stars: ✭ 214 (+114%)
Mutual labels:  lib
Imageflow
High-performance image manipulation for web servers. Includes imageflow_server, imageflow_tool, and libimageflow
Stars: ✭ 3,643 (+3543%)
Mutual labels:  lib
Appmetrics.js
A small (< 1kb) library for measuring things in your web app and reporting the results to Google Analytics.
Stars: ✭ 1,383 (+1283%)
Mutual labels:  lib
Mtproto Core
Telegram API JS (MTProto) client library for browser and nodejs
Stars: ✭ 242 (+142%)
Mutual labels:  lib
Weworkapi php
official lib of wework api
Stars: ✭ 225 (+125%)
Mutual labels:  lib
Math Engine
Mathematical expression parsing and calculation engine library. 数学表达式解析计算引擎库
Stars: ✭ 123 (+23%)
Mutual labels:  lib

rawhttp

rawhttp is a Go package for making HTTP requests in a raw way.

Example

First you need to declare a server

...
...

func headers(w http.ResponseWriter, req *http.Request) {
	for name, headers := range req.Header {
		for _, h := range headers {
			fmt.Fprintf(w, "%v: %v\n", name, h)
		}
	}
}

func main() {
	http.HandleFunc("/headers", headers)
	if err := http.ListenAndServe(":10000", nil); err != nil {
		gologger.Fatal().Msgf("Could not listen and serve: %s\n", err)
	}
}
go run server.go

Second you need to start the client

func main() {
    host := "127.0.0.1:10000"
	swg := sizedwaitgroup.New(25)
	pipeOptions := rawhttp.DefaultPipelineOptions
	pipeOptions.Host = host
	pipeOptions.MaxConnections = 1
	pipeclient := rawhttp.NewPipelineClient(pipeOptions)
	for i := 0; i < 50; i++ {
		swg.Add()
		go func(swg *sizedwaitgroup.SizedWaitGroup) {
			defer swg.Done()
			req, err := http.NewRequest("GET", host + "/headers", nil)
			if err != nil {
				log.Printf("Error sending request to API endpoint. %+v", err)
				return
			}
			req.Host = host
			req.Header.Set("Host", host)
			resp, err := pipeclient.Do(req)
			if err != nil {
				log.Printf("Error sending request to API endpoint. %+v", err)
				return
			}
			log.Printf("%+v\n", resp)
			_ = resp
		}(&swg)
	}

	swg.Wait()

}
go run client.go

License

rawhttp is distributed under MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].