• Stars
    star
    272
  • Rank 150,851 (Top 3 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

http2client

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 ping Send a ping.
  • h2c pid Show the process id of the h2c process.
  • h2c push-list List responses that are available as push promises.
  • h2c stream-info List streams and their states.
  • 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.12.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.6. The external dependencies are located in the vendor/ directory. In Go 1.6, the vendor/ directory will be used by default. In order to build h2c with Go 1.5, 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:

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:

More Repositories

1

grok_exporter

Export Prometheus metrics from arbitrary unstructured log data.
Go
889
star
2

cifs

CIFS Flexvolume Plugin for Kubernetes
Shell
211
star
3

promagent

Prometheus Monitoring for Java Web Applications without Modifying their Source Code
Java
83
star
4

prometheus-for-java-developers

Prometheus for Java Developers Demo
79
star
5

go-programming-for-java-developers

Golang Programming Workshop
72
star
6

http2-examples

Java
49
star
7

docker-aws-cli

Docker image for running the AWS command line interface.
28
star
8

diy-kubernetes

Do-It-Yourself Kubernetes in the Hetzner Cloud
HCL
14
star
9

fosdem-2023

Shell
12
star
10

docker-mutt

11
star
11

docker-weechat-otr

Run the weechat IRC client with Off-the-Record (OTR) encryption.
11
star
12

javazone-2023

Java
8
star
13

basic-ubuntu-server-setup

3
star
14

promagent-operator

Demo: Kubernetes operator for the Prometheus monitoring Java agent
Go
3
star
15

jug-oberpfalz-prometheus-java

3
star
16

exim_prometheus_exporter

Go
3
star
17

docker-grip

Docker image for viewing Markdown pages
3
star
18

quarkus-demo

Java
3
star
19

jcon-2023

Java
3
star
20

java-demo

Java Demo Application for Kubernetes
Java
2
star
21

jbcn.conf-2022

Java
2
star
22

docker-grok_exporter-compiler

Shell
2
star
23

docker-bower

develop bower projects without installing bower
Shell
2
star
24

diy-kubernetes-basic

Basic Kubernetes Setup with Terraform and Ansible
HCL
2
star
25

client_java-otel-example

Example of Pushing Prometheus Metrics to a Prometheus Server via OpenTelemetry's OTLP
Java
1
star
26

docker-prometheus-demo

Ubuntu with Prometheus downloads in /root/.
1
star
27

pam-truecrypt

C
1
star
28

docker-wildfly-http2

Shell
1
star
29

docker-ubuntu

Extended Ubuntu base image
1
star
30

devoxx-be-2022-latency

Java
1
star
31

s3diff

Compare a local directory with its back-up on Amazon S3.
Ruby
1
star
32

docker-asciidoc

1
star
33

spring-boot-2-opentelemetry-traces

Demo project showing Prometheus Exemplars for Spring Boot 2 Prometheus metrics with OpenTelemetry traces
Java
1
star
34

music-box

C
1
star
35

micrometer-config-example

Examples of How To Configure Micrometer Metrics in Spring Boot
Java
1
star
36

docker-go

Test go programs in a Linux container.
1
star
37

node-imap

An IMAP client module for node.js.
JavaScript
1
star