All Projects → dcb9 → boast

dcb9 / boast

Licence: MIT license
I want track all HTTP requests, and replay it easily.

Programming Languages

go
31211 projects - #10 most used programming language
Vue
7211 projects
javascript
184084 projects - #8 most used programming language
Makefile
30231 projects
HTML
75241 projects

Projects that are alternatives of or similar to boast

Host
Expose your LocalHost with this tool
Stars: ✭ 268 (+339.34%)
Mutual labels:  curl, ngrok
CurlDSL
CurlDSL converts cURL commands into URLRequest objects
Stars: ✭ 56 (-8.2%)
Mutual labels:  curl
SReplay
Server-side recording mod for ReplayMod
Stars: ✭ 44 (-27.87%)
Mutual labels:  replay
orca
C Multi-REST API library for Discord, Slack, Reddit, etc.
Stars: ✭ 360 (+490.16%)
Mutual labels:  curl
boilerplate-react-redux-pwa
It's sample boilerplate with pwa + react + redux + redux-saga
Stars: ✭ 14 (-77.05%)
Mutual labels:  ngrok
rocket-league-replay-analysis
UNMAINTAINED - Creating videos for Analyzing Rocket League Replays (https://gitlab.com/enzanki_ars/rocket-league-replay-analysis)
Stars: ✭ 24 (-60.66%)
Mutual labels:  replay
curlconverter
➰ ➡️ ➖ Translate cURL command lines into parameters for use with httr or actual httr calls (R)
Stars: ✭ 86 (+40.98%)
Mutual labels:  curl
axios-curlirize
axios plugin converting requests to cURL commands, saving and logging them.
Stars: ✭ 152 (+149.18%)
Mutual labels:  curl
squirrel
Like curl, or wget, but downloads directly go to a SQLite databse
Stars: ✭ 24 (-60.66%)
Mutual labels:  curl
learn-ngrok
☁️ Learn how to use ngrok to share access to a Web App/Site running on your "localhost" with the world!
Stars: ✭ 50 (-18.03%)
Mutual labels:  ngrok
curl-worker
No description or website provided.
Stars: ✭ 42 (-31.15%)
Mutual labels:  curl
osuElements
A .NET framework for osu! (osu.ppy.sh) applications
Stars: ✭ 33 (-45.9%)
Mutual labels:  replay
Vapecord-ACNL-Plugin
Animal Crossing NL Vapecord Public Plugin WIP
Stars: ✭ 72 (+18.03%)
Mutual labels:  replay
cj
正方教务系统成绩查询手机版,结合Weui,自动识别验证码
Stars: ✭ 20 (-67.21%)
Mutual labels:  curl
GitHubAPI
[UNMAINTAINED] This is a simple Object Oriented wrapper for GitHub API v3, written with PHP7.
Stars: ✭ 36 (-40.98%)
Mutual labels:  curl
express-facebook-messenger
Facebook Messenger Bot API utility
Stars: ✭ 20 (-67.21%)
Mutual labels:  ngrok
Fetch
Asynchronous HTTP client with promises.
Stars: ✭ 29 (-52.46%)
Mutual labels:  curl
ReplayZero
Record local web traffic on your laptop and generate functional API tests, utilizing open source industry standards like Karate and Gatling
Stars: ✭ 25 (-59.02%)
Mutual labels:  replay
php-curl-cookbook
PHP CURL Cookbook 📖
Stars: ✭ 83 (+36.07%)
Mutual labels:  curl
libopenTIDAL
TIDAL API interface written in ANSI C
Stars: ✭ 17 (-72.13%)
Mutual labels:  curl

中文

Boast

"I want track all requests, and replay it easily."

Integrate with Go HTTP servers

Install the boast package:

go get github.com/dcb9/boast

After installing, modify your server file

with default HTTP server

package main

import (
	"fmt"
	"net/http"
	"net/http/httptest"

	"github.com/dcb9/boast"
)

func main() {
	mux := http.NewServeMux()
	mux.HandleFunc("/", http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
		fmt.Fprintf(w, "Welcome to the home page!")
	}))

-	// in old way
-	http.ListenAndServe(":8080", mux)
+	// in boast way
+	server := httptest.NewServer(mux)
+	addr, debugAddr := ":8080", ":8079"
+	boast.Serve(server, addr, debugAddr)
}

with Echo web framework

package main

import (
	"net/http"
	"net/http/httptest"
	"github.com/dcb9/boast"
	"github.com/labstack/echo"
)

func main() {
	e := echo.New()
	e.GET("/", func(c echo.Context) error {
		return c.String(http.StatusOK, "Hello, World!")
	})

-   e.Logger.Fatal(e.Start(":8080"))
+	server := httptest.NewServer(e)
+	addr, debugAddr := ":8080", ":8079"
+	boast.Serve(server, addr, debugAddr)
}

Run

Then run your server:

go run server.go

First request your server as usual, then you can visit debug panel ( http://localhost:8079 )

Standalone

Install

Download the latest binary file from the Releases page.

(darwin_amd64.tar.gz is for Mac OS X users)

Usage

$ cat .boast.json
{
	"debug_addr": ":8079",
	"list": [
		{ "url": "https://www.baidu.com/", "addr": ":8080" },
		{ "url": "https://github.com/", "addr": ":8081" }
	]
}

$ boast -c .boast.json

$ boast --help
Usage of boast:
  -c string
       config file path (default ".boast.json")

Sketch

HTTP Client                   Boast                       WebServer
| GET http://localhost:8080/   | Record and Reverse Proxy    | Response 200 OK
| ---------------------------> | --------------------------> | ------┐
|                              |                             |       |
|                              |     Record and Forward      |  <----┘
| <--------------------------- | <-------------------------- |

┌----------------------------------------------------------------------------┐
| url: http://localhost:8081                                                 |
| ---------------------------------------------------------------------------|
| All Transactions         ┌ - - - - - - - - - - - - - - - - - - - - - - - ┐ |
| ----------------------   | time: 10 hours ago  Client: 127.0.0.1         | |
| |GET / 200 OK 100 ms |   |                                               | |
| ----------------------   | Request                      [ Replay ]       | |
|                          | -   -   -   -   -   -   -   -   -   -   -   - | |
|                          | GET http://localhost/ HTTP/1.1                | |
|                          | User-Agent: curl/7.51.0                       | |
|                          | Accept: */*                                   | |
|                          |                                               | |
|                          | Response                                      | |
|                          | -   -   -   -   -   -   -   -   -   -   -   - | |
|                          | HTTP/1.1 200 OK                               | |
|                          | X-Server: HTTPLab                             | |
|                          | Date: Thu, 02 Mar 2017 02:25:27 GMT           | |
|                          | Content-Length: 13                            | |
|                          | Content-Type: text/plain; charset=utf-8       | |
|                          |                                               | |
|                          | Hello, World                                  | |
|                          └ - - - - - - - - - - - - - - - - - - - - - - - ┘ |
|                                                                            |
└----------------------------------------------------------------------------┘

Warning

DO NOT USE ON PRODUCTION!

Boast is heavily inspired by ngrok.

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].