Code Monkey home page Code Monkey logo

h2c's Introduction

h2c - A Simple HTTP/2 Command-Line Client

h2c is a simple HTTP/2 command-line client, like curl.

While curl terminates after each request/response cycle, h2c runs a background process to keep connections open. That way, h2c may receive asynchronous push messages from the server.

h2c is currently in a very early stage. The best way to learn about it is to read the blog posts on unrestful.io.

Screenshots

h2c dump

h2c command line

Basic Usage

h2c start &
h2c connect http2.akamai.com
h2c get /index.html
h2c stop

Command Overview

For a complete list of available commands, run h2c --help.

  • h2c start [options] Start the h2c process. The h2c process must be started before running any other command.
  • h2c connect [options] <host>:<port> Connect to a server using https
  • h2c disconnect Disconnect from server
  • h2c get [options] <path> Perform a GET request
  • h2c post [options] <path> Perform a POST request
  • h2c set <header-name> <header-value> Set a header. The header will be valid for all subsequent requests.
  • h2c unset <header-name> [<header-value>] Undo 'h2c set'.
  • h2c pid Show the process id of the h2c process.
  • h2c push-list List responses that are available as push promises.
  • h2c stop Stop the h2c process
  • h2c wiretap <localhost:port> <remotehost:port> Listen on localhost:port and forward all traffic to remotehost:port.

How to Download and Run

Binary releases are available on the GitHub Releases.

  1. Download the latest release ZIP file: h2c-v0.0.8.zip
  2. Extract the ZIP file
  3. Find the executable for your system in the bin folder:
  • Linux: h2c_linux_amd64
  • OS X: h2c_darwin_amd64
  • Windows: h2c_windows_amd64.exe
  1. Rename that executable to h2c, or h2c.exe on Windows
  2. Move the executable into a folder on your PATH.

How to Build from Source

h2c is developed with go 1.5.1. The external dependencies are located in the vendor folder, in order to load these dependencies, you must enable the Go 1.5 Vendor Handling by setting the environment variable GO15VENDOREXPERIMENT to 1.

The following command will download, compile, and install h2c:

export GO15VENDOREXPERIMENT=1
go get github.com/fstab/h2c

Related Work

h2c uses parts of Brad Fitzpatrick's HTTP/2 support for Go. There is an HTTP/2 console debugger included in bradfitz/http2, but just like h2c, it is currently only a quick few hour hack, so it is hard to tell if they aim at the same kind of tool.

LICENSE

h2c is licensed under the Apache License, Version 2.0.

h2c is implemented in Go and uses Go's standard library, which is licensed under Google's Go license, which is a variant of the BSD License.

The following 3rd party libraries are used:

h2c's People

Contributors

fstab avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.