{"id":20295960,"url":"https://github.com/kkrull/gohttp","last_synced_at":"2025-06-21T06:04:06.480Z","repository":{"id":81678667,"uuid":"125908819","full_name":"kkrull/gohttp","owner":"kkrull","description":"HTTP server in Go","archived":false,"fork":false,"pushed_at":"2018-06-10T21:27:03.000Z","size":472,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T05:41:37.683Z","etag":null,"topics":["golang","http"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kkrull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-19T19:21:00.000Z","updated_at":"2024-05-06T15:59:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"732fb262-41a3-4719-bdfa-973f0fe0e421","html_url":"https://github.com/kkrull/gohttp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kkrull/gohttp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkrull%2Fgohttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkrull%2Fgohttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkrull%2Fgohttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkrull%2Fgohttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kkrull","download_url":"https://codeload.github.com/kkrull/gohttp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkrull%2Fgohttp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261073297,"owners_count":23105637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","http"],"created_at":"2024-11-14T15:36:49.342Z","updated_at":"2025-06-21T06:04:01.459Z","avatar_url":"https://github.com/kkrull.png","language":"Go","readme":"# HTTP Server for Go [![Build Status](https://travis-ci.org/kkrull/gohttp.svg?branch=master)](https://travis-ci.org/kkrull/gohttp)\n\nThis is an HTTP server for Go.\n\n\n## Requirements\n\nThis is being developed on Go 1.10, 64-bit.\n\n\n## Installation\n\nInstall Go 1.10 with [their installer](https://golang.org/doc/install), or with `brew install go` if you use homebrew.\n\n\n### Set up Go environment\n\nGo recommends following a few conventions on setting up your environment\n\n* Set `GOPATH`.  You can set it to the value from `go env GOPATH`, if you're not sure of the conventional path\n  on your system.\n* Add Go binaries to your system path.  I recommend putting the following into your startup scripts (`.bash_profile` et al)\n\n```bash\ngo version \u003e/dev/null 2\u003e\u00261\nif (( $? == 0 ))\nthen\n  export PATH=\"$PATH:$(go env GOPATH)/bin\"\nfi\n```\n\n\n### Install support tools\n\nThis installs [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) for formatting and organizing imports\nand [ginkgo](http://onsi.github.io/ginkgo/) for spec-style testing.\n\n```bash\n$ go get github.com/onsi/ginkgo/ginkgo\n$ go get golang.org/x/tools/cmd/goimports\n```\n\nWhen you are done, `GOPATH/bin` should contain `ginkgo` and `goimports`.  \n`which ginkgo` and `which goimports` should then work if the binaries are installed and present in your `PATH`.\n\n\n### Clone this repository\n\n```bash\n$ cd $(go env GOPATH)\n$ mkdir src\n$ cd src\n$ git clone git@github.com:kkrull/gohttp.git\n```\n\n### Set up `pre-push` hook\n\nSet up a Git hook to double check that code is formatted and imports are sorted/curated before pushing.\n\n```bash\n$ cp bin/pre-push .git/hooks/pre-push\n```\n\n\n## Running\n\nFrom the path where you cloned this repository:\n\n```bash\n$ go get -t -u -v\n$ go build\n$ ./gohttp -p \u003cport\u003e -d \u003ccontent root directory\u003e\n```\n\nNote that if you build and run this with `go run`, it will not\n[handle `SIGTERM` from Ctrl+C](https://stackoverflow.com/questions/11268943/is-it-possible-to-capture-a-ctrlc-signal-and-run-a-cleanup-function-in-a-defe)\ncorrectly.\n\nWhen you want to exit the server, press `Ctrl+C`.\n\n\n## Linting\n\nInstall [`gometalinter`](https://github.com/alecthomas/gometalinter)\n\n```bash\n$ go get -u gopkg.in/alecthomas/gometalinter.v2\n```\n\nwhich - if you set up your path correctly in the earlier steps - places `gometalinter.v2` in your `PATH`.\nRun the linters configured in `.gometalinter.json` with `gometalinter.v2 ./...` in the base of this repository.\n\n\n## Testing\n\n```bash\n$ go get -t #Download dependencies, including those used by tests\n$ ginkgo -r #Run tests in all packages\n```\n\nContinuous Integration happens on [Travis CI](https://travis-ci.org/kkrull/gohttp).\nSee `.travis.yml` in this repository for details in the CI environment and how the tests are run.\n\nAdditional testing is performed by a version of `cob_spec` that has been configured to start/stop this server.\nThis version of `cob_spec` can be found [on GitHub](https://github.com/kkrull/cob_spec).\n\n\n## Support scripts\n\nA few steps of the development process are being automated, as the project takes shape.\nThese are located in the `bin/` directory:\n\n* `bin/build-and-start.sh`: Re-builds the local binary `gohttp` and runs it.  Pass it the same options you would if you\n  were running `gohttp` directly.\n* `bin/update-dependencies.sh`: Updates all Go libraries in your `GOPATH` and runs tests to make sure everything still\n  works.  *Note that this repository's current branch must have an upstream branch, for this to work.*\n\n\n## Developer notes\n\n### `cob_spec` Nuances\n\nIf `gohttp` goes down, `cob_spec` will:\n\n- take about 30 seconds to time out\n- fail all tests after the process went down (this may not be exactly after the failed test, due to potential timing,\n  concurrency, and synchronization issues)\n- swallow any output that was given to the console\n\n**If `cob_spec` fails in strange ways where it looked like it was working before...**:\n\n- Try the request in cURL\n- Make sure there are no `panics`\n\n\n### TCP Traffic\n\nWhen the server just listens, accepts, and closes a connection.\n\n```bash\n$ ./gohttp -p 1234 -d ... #Server\n$ netcat -vz -4 localhost 1234 #Client\n```\n\nPacket sniffing\n\n```bash\n$ tcpdump -D #Show interfaces; find localhost\n$ tcpdump -i \u003cinterface\u003e -s 0 -w gohttp--netcat-4.pcap #Capture\n$ tcpdump -4 \u003cfile\u003e #View file\n```\n\nThere's also `curl --trace \u003chex as ascii dump file\u003e ...`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkrull%2Fgohttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkkrull%2Fgohttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkrull%2Fgohttp/lists"}