The interactive web server

HTTPLAB

Build Status Go Report Card PRs Welcome

The interactive web server.

HTTPLabs let you inspect HTTP requests and forge responses.


screencast

Install

Golang

go get github.com/gchaincl/httplab
go install github.com/gchaincl/httplab/cmd/httplab

Archlinux

yaourt httplab

Snap FIXME

On systems where snap is supported:

snap install httplab

Binary distribution

Each release provides pre-built binaries for different architectures, you can download them here: https://github.com/gchaincl/httplab/releases/latest

Help

Usage of httplab:
  -a, --auto-update       Auto-updates response when fields change. (default true)
  -b, --body string       Specifies the inital response body. (default "Hello, World")
  -c, --config string     Specifies custom config path.
      --cors              Enable CORS.
      --cors-display      Display CORS requests. (default true)
  -d, --delay int         Specifies the initial response delay in ms.
  -H, --headers strings   Specifies the initial response headers. (default [X-Server:HTTPLab])
  -p, --port int          Specifies the port where HTTPLab will bind to. (default 10080)
  -s, --status string     Specifies the initial response status. (default "200")
  -v, --version           Prints current version.

Key Bindings

Key Description
Tab Next Input
Shift+Tab Previous Input
Ctrl+a Apply Response changes
Ctrl+r Resets Request history
Ctrl+s Save Response as
Ctrl+f Save Request as
Ctrl+l Toggle Responses list
Ctrl+t Toggle Response builder
Ctrl+o Open Body file
Ctrl+b Switch Body mode
Ctrl+h Toggle Help
Ctrl+w Toggle line wrapping
q Close popup
PgUp Previous Request
PgDown Next Request
Ctrl+c Quit

HTTPLab uses file to store pre-built responses, it will look for a file called .httplab on the current directory if not found it will fallback to $HOME. A sample file can be found here.

HTTPLab is heavily inspired by wuzz

Owner
Gustavo Chaín
Technical Dealer
Gustavo Chaín
Comments
  • "Save response as" not working

    I tried to do "Save response as", and got the message "open /home/steven/.httplab: permission denied".

    I tried making a directory .httplab (complained that it was a directory), and later a text file (complained permission denied).

    I tried saving using a relative file name, and a full file name, and nothing was saved.

  • can not run ?

    can not run ?

    Just git clone the repository and go run main.go, but it show below message

    # command-line-arguments
    ./main.go:13: undefined: UI
    ./main.go:16: undefined: DumpRequest
    ./main.go:42: undefined: NewUI
    
  • Text selecting support using mouse

    Text selecting support using mouse

    Unless you're using tmux (or some terminal multiplexer) copying text to the clipboard it's hard, this is mainly because you can't select text using the mouse. This would be a nice to have feature.

  • Buffer Request Pane

    Buffer Request Pane

    Would be nice to be able to scroll through previous requests, or support having multiple requests on-screen at once.

    Useful when debugging something that sends multiple different payloads - can just point them all at httplab and understand the flow.

  • Updates |DumpRequest| to iterate over Header keys alphabetically

    Updates |DumpRequest| to iterate over Header keys alphabetically

    Adds functionality per issue #47 -- simply added a function to sort the request headers alphabetically and call said function prior to iterating over the request header map in DumpRequest

  • Add snapcraft yaml to enable builds of snaps

    Add snapcraft yaml to enable builds of snaps

    Hello!

    This PR adds support for building snaps of httplab via snapcraft - see http://snapcraft.io/ for more information. Hooking this up means that builds of master can be pushed to the store and make latest builds of httplab are immediately available to millions of users.

    To test the build used to make the snap, on an up to date 16.04 machine

    apt install snapcraft

    git clone http://github.com/popey/httplab git checkout add-snapcraft cd httplab snapcraft

    This will build a snap which can be installed via:-

    snap install httplab_0.1.0+git_amd64.snap --dangerous

    (the --dangerous is required as it's an unsigned package being side-loaded, rather than a signed one from the store).

    Test the application as expected.

    Would be great to get this merged, and then hook up the automated builds to land in the store directly, as per http://snapcraft.io/docs/build-snaps/ci-integration. Happy to help through that process. We also have an automated system at http://build.snapcraft.io/ which could be used to auto-build and push to the store.

    Once published in the store, it can be installed with:-

    snap install httplab --edge

    Later, when pushed to the stable store, it can be installed with:-

    snap insatll httplab

  • Configuration file

    Configuration file

    Would be super neat if the tool could either pick up the .httplab config file from the current directory or via command line argument (similar to the port configuration). That would allow to have different saved requests for different projects and also to version control the saved requests.

  • Added graceful shutdown, closes #66

    Added graceful shutdown, closes #66

    This PR implements Graceful shutdown. The message is shown in log output as opposed to GUI. We might think about changing that, but it would require more of a code structure rewrite. Another improvement could be to add deadline to shutdown operation.

  • Display request headers sorted

    Display request headers sorted

    As request headers are implemented as a map, the order of the keys are not guaranteed. It would be nice to display all the request header sorted alphabetically, so that is easy to identify changes from one request to the other

  • Can't load package: package github.com/gchaincl/httplab/cmd/httplab

    Can't load package: package github.com/gchaincl/httplab/cmd/httplab

    I'm not a Go developer, so only following the instruction in the README:

    $ go install github.com/gchaincl/httplab/cmd/httplab
    can't load package: package github.com/gchaincl/httplab/cmd/httplab: cannot find package "github.com/gchaincl/httplab/cmd/httplab" in any of:
    	/usr/local/go/src/github.com/gchaincl/httplab/cmd/httplab (from $GOROOT)
    	/home/user/go/src/github.com/gchaincl/httplab/cmd/httplab (from $GOPATH)
    

    There is a remote location to install this package? Do I have to download the sources an place them into the /usr/local/go/ folder to install it? Because /usr/local/go is not a user folder, It shouldn't be required to install an app like this, and isn't specified in the README instructions.

  • Body (Input) is not updated

    Body (Input) is not updated

    Hi,

    maybe I am missing something very obvious, but for me the Editor field for "Body (Input)" is not working.

    Changes, which I make to the Status, Delay or Header Fields take effect. When I load a predefined Reponse body from the .httplab file, the changes take effect. But when I enter a Response Body by hand in the editor field, the body returned does not reflect the change (regardless, whether I stay in the Editor, change to another input field, use Ctrl-A for updating the response or not)

    Any ideas, why this happens? I have tried to locate the issue, but since I do not know go, it is quite hard.

  • No information returned

    No information returned

    $uri="172.245.118.60" $headers=@{ "content-length"= "215" "cache-control"= "max-age=0" "upgrade-insecure-requests"= "1" "user-agent"= "Mozilla/5.0 (Linux; Android 9; LM-G710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Mobile Safari/537.36" "sec-fetch-mode"= "navigate" "sec-fetch-user"= "?1" "content-type"= "application/x-www-form-urlencoded" "dnt"= "1" "accept"= "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3" "sec-fetch-site"= "none" "accept-encoding"= "gzip, deflate, br" "accept-language"= "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7" } Invoke-WebRequest $uri -Method Post -Headers $headers

  • Problems rendering on tmux

    Problems rendering on tmux

    There are some issues when using it inside tmux 2.9a, it renders incorrec t characters and doesn't allow to use arrow keys, neither to use it at all actually, tried in different terminals:

    • Termite
    • rxvt-unicode
    • xterm
    • alacritty

    using both zsh and bash and evertything works fine on it's own, but in tmux it presents this problem (screenshot in link)

    I'm using archlinux and tmux 2.9a

    tried installation from AUR, with golang and from source, problem persists and it's only when inside tmux

    [screenshot](https://i.imgur.com/J9lV3I5.

    Edit

    it works when changing TERM variable inside tmux either from tmux-256color to tmux or screen-256color to screen

  • Snap package unavailable

    Snap package unavailable

    Looks like httplab disappeared from Snap https://snapcraft.io/search?q=httplab

    It's possible to create new snaps automatically in CI https://docs.snapcraft.io/build-snaps/ci-integration

  • Create a generic install script

    Create a generic install script

    Projects like brew provides a handy way to install. It would be great to have something similar that depending on your architecture, fetches the righ binary and copies it to some $PATH.

    A simple bash script should be enough to start,

  • Customizable keybindings

    Customizable keybindings

    Having configurable key bindings would be a nice addition. I can implement this to store custom key bindings in ~/.httplab, is this a good place for such change?

Server-sent events for Go

eventsource eventsource provides server-sent events for net/http server. Usage SSE with default options package main import ( "gopkg.in/antage/ev

Dec 28, 2022
Fibonacci RESTful API - HTTP server that listens on a given port

Fibonacci RESTful API - HTTP server that listens on a given port

Jan 19, 2022
The interactive web server
The interactive web server

The interactive web server. HTTPLabs let you inspect HTTP requests and forge responses. Install Golang go get github.com/gchaincl/httplab go install g

Dec 24, 2022
Go web server - A web server that can accept a GET request and serve a response.

go_web_server A web server that can accept a GET request and serve a response. Go is a great language for creating simple yet efficient web servers an

Jan 3, 2022
Witty - An unsafe web server to export shell to web
Witty - An unsafe web server to export shell to web

WiTTY: Web-based interactive TTY This program allows you to use terminal in the

Dec 30, 2022
Building powerful interactive prompts in Go, inspired by python-prompt-toolkit.
Building powerful interactive prompts in Go, inspired by python-prompt-toolkit.

go-prompt A library for building powerful interactive prompts inspired by python-prompt-toolkit, making it easier to build cross-platform command line

Jan 3, 2023
Simple in Pure Go in Browser Interactive Interpreter
Simple in Pure Go in Browser Interactive Interpreter

GoBook This project is a PoC Don't take it seriously The main point of this project is the use of the library: github.com/brendonmatos/golive Maybe th

Feb 22, 2022
Provides AWS STS credentials based on Google Apps SAML SSO auth with interactive GUI support
Provides AWS STS credentials based on Google Apps SAML SSO auth with interactive GUI support

What's this This command-line tool allows you to acquire AWS temporary (STS) credentials using Google Apps as a federated (Single Sign-On, or SSO) pro

Sep 29, 2022
Abacus is a simple interactive calculator CLI

Abacus is a simple interactive calculator CLI with support for variables, comparison checks, and math functions abacus -

Sep 15, 2022
rtop is an interactive, remote system monitoring tool based on SSH

rtop rtop is a remote system monitor. It connects over SSH to a remote system and displays vital system metrics (CPU, disk, memory, network). No speci

Dec 30, 2022
Interactive package manager and resource monitor designed for the GNU/Linux.
Interactive package manager and resource monitor designed for the GNU/Linux.

pkgtop is an interactive package manager & resource monitor tool designed for the GNU/Linux. Package management (install/upgrade/remove etc.) can be a

Dec 28, 2022
Automatically spawn a reverse shell fully interactive for Linux or Windows victim
Automatically spawn a reverse shell fully interactive for Linux or Windows victim

Girsh (Golang Interactive Reverse SHell) Who didn't get bored of manually typing the few lines to upgrade a reverse shell to a full interactive revers

Dec 14, 2022
🔥 [WIP] Interactive Jira Command Line
🔥 [WIP] Interactive Jira Command Line

JiraCLI Interactive Jira CLI ?? This project is still a work in progress ?? This tool mostly focuses on issue search and navigation at the moment. How

Jan 4, 2023
Building powerful interactive prompts in Go, inspired by python-prompt-toolkit.
Building powerful interactive prompts in Go, inspired by python-prompt-toolkit.

go-prompt A library for building powerful interactive prompts inspired by python-prompt-toolkit, making it easier to build cross-platform command line

Jan 3, 2023
Simplistic interactive filtering tool
Simplistic interactive filtering tool

peco Simplistic interactive filtering tool NOTE: If you are viewing this on GitHub, this document refers to the state of peco in whatever current bran

Dec 30, 2022
Elvish = Expressive Programming Language + Versatile Interactive Shell

Elvish: Expressive Programming Language + Versatile Interactive Shell Elvish is an expressive programming language and a versatile interactive shell,

Dec 25, 2022
A fast and lightweight interactive terminal based UI application for tracking cryptocurrencies 🚀
A fast and lightweight interactive terminal based UI application for tracking cryptocurrencies 🚀

cointop is a fast and lightweight interactive terminal based UI application for tracking and monitoring cryptocurrency coin stats in real-time.

Jan 6, 2023
Provides an interactive prompt to connect to ECS Containers using the ECS ExecuteCommand API.
Provides an interactive prompt to connect to ECS Containers using the ECS ExecuteCommand API.

ecsgo Heavily inspired by incredibly useful gossm, this tool makes use of the new ECS ExecuteCommand API to connect to running ECS tasks. It provides

Dec 12, 2022
Easy Go GUI wrapper for interactive manipulation of visual algorithms/backend code.
Easy Go GUI wrapper for interactive manipulation of visual algorithms/backend code.

RenderView ================ Install: go get github.com/TheGrum/renderview Needs either Shiny (limited functionality), Gio, go-gtk, or gotk3. The latt

Aug 4, 2022
Terminal UI library with rich, interactive widgets — written in Golang
Terminal UI library with rich, interactive widgets — written in Golang

Rich Interactive Widgets for Terminal UIs This Go package provides commonly needed components for terminal based user interfaces. Among these componen

Jan 7, 2023