https://github.com/entrlcom/go-http-server
HTTP server with tuned and hardened defaults ready for Internet exposure.
https://github.com/entrlcom/go-http-server
go golang http-server security
Last synced: about 1 year ago
JSON representation
HTTP server with tuned and hardened defaults ready for Internet exposure.
- Host: GitHub
- URL: https://github.com/entrlcom/go-http-server
- Owner: entrlcom
- License: mit
- Created: 2024-05-30T17:28:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-31T10:08:45.000Z (about 2 years ago)
- Last Synced: 2025-02-02T02:45:43.443Z (over 1 year ago)
- Topics: go, golang, http-server, security
- Language: Go
- Homepage: https://blog.cloudflare.com/exposing-go-on-the-internet
- Size: 4.88 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HTTP server
## Table of Content
- [Examples](#examples)
- [License](#license)
- [Links](#links)
## Examples
```go
package main
import (
"context"
"entrlcom.dev/http-server"
)
func main() {
ctx := context.Background()
// HTTP server.
httpServer := http_server.NewHTTPServer()
httpServer.Addr = "" // TODO: set address.
httpServer.Handler = nil // TODO: set handler.
if err := httpServer.ListenAndServe(); err != nil {
// TODO: Handle error.
return
}
// ...
// Shutdown HTTP server.
if err := httpServer.Shutdown(ctx); err != nil {
// TODO: Handle error.
return
}
// ...
}
```
## License
[MIT](https://choosealicense.com/licenses/mit/)
## Links
* [So you want to expose Go on the Internet](https://blog.cloudflare.com/exposing-go-on-the-internet/)