<commit_before>go-server
=========

An easy to use HTTPS server written in Go.  It uses the standard library, and provides some benefits over using the standard library directly:

* Can gracefully shut down active connections.
* Can detach and reattach listeners, which allows for low (zero?) downtime restarts.

Usage is simple:

```
if err := server.HTTPS("127.0.0.1:443", "localhost", "./cert.file", "./key.file", nil); if err != nil {
	log.Fatal("Error starting server:", err)
}
// Do stuff
server.Shutdown()
```
<commit_msg>Update example to reflect current usage.<commit_after>go-server
=========

An easy to use HTTPS server written in Go.  It uses the standard library, and provides some benefits over using the standard library directly:

* Can gracefully shut down active connections.
* Can detach and reattach listeners, which allows for low (zero?) downtime restarts.

Usage is simple:

```
import (
	"github.com/timewasted/go-server"
	...
)

// Listen on localhost on ports 443 and 44380
addrs := []string{
	"127.0.0.1:443",
	"127.0.0.1:44380",
}

// The above addresses are serving server1.example.com and server2.example.com
keyPairs := map[string]string{
	"server1.example.com.crt": "server1.example.com.key",
	"server2.example.com.crt": "server2.example.com.key",
}

if err := server.HTTPS(addrs, keyPairs, nil); if err != nil {
	log.Fatal("Error starting server:", err)
}
// Do stuff
server.Shutdown()
```

{'fraction_non_alphanumeric': 0.1404494382022472, 'fraction_numerical': 0.030196629213483147, 'mean_word_length': 4.297397769516729, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3643158', 'n_tokens_mistral': 475, 'n_tokens_neox': 443, 'n_words': 157}