Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.
/ cmdr-http2 Public archive

a http2 server with `cmdr` full daemon supports and graceful shutdown.

License

Notifications You must be signed in to change notification settings

hedzr/cmdr-http2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

163230d · Sep 27, 2020
Jan 15, 2020
Sep 27, 2020
Sep 27, 2020
Jun 17, 2019
Oct 9, 2019
Apr 15, 2020
Jun 17, 2019
May 10, 2020
Feb 4, 2020
Mar 7, 2020
Jan 15, 2020
Sep 27, 2020
Sep 27, 2020

Repository files navigation

cmdr-http2

A cmdr demo app. cmdr-http2 implements a http2 server with full daemon supports and graceful shutdown.

NOTE: need cmdr v1.6.25+ [20200204]

# clone and init
git clone https://github.com/hedzr/cmdr-http2.git
cd cmdr-http2
go mod download

# run server
go run ./cli/ server run &

# run client and make an request
go run ./cli/ h2

# or via curl
curl -k https://localhost:5151/

#
# Build the binary
#
go build -o bin/cli ./cli/
# or:
make build

# Shell prompt mode
$ go run ./cli/ shell
>>> --help
>>> quit
# type <space> to get auto-completion tip
# type sub-commands

Plugins for cmdr System

sample

sample plugin give a example to howto modify cmdr daemon plugin server start command at an appropriate time.

trace

trace plugin adds a trace option to cmdr system.

shell

enable shell prompt mode inside app.

cmdr-http2 Shell Prompt Mode:

image

Shell prompt mode

the feature is powered by c-bata/go-prompt.

New H2 Server since v1.3.5

  • supports autocert, std TLS, ...
  • supports graceful-shutdown
  • supports hot-reload
  • demostrates howto use various of Go Web Frameworks: std go/http, iris, gin, ...

create certificates for testing

This command will generate CA, server, client certificates and wrote them into ./ci/certs for h2 server loading.

bin/cmdr-http2 server certs create
bin/cmdr-http2 server certs create --help
bin/cmdr-http2 server certs --help

See the source codes for more information.

configuration file(s)

In the project root directory, cmdr-http2.yml will be loaded as main config file, this depends on cmdr config file searching algorithm. See also cmdr.WithPredefinedLocations(locations...).

LICENSE

MIT

About

a http2 server with `cmdr` full daemon supports and graceful shutdown.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published