Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paultag/sniff
Dispatch TLS Connections based on SNI
https://github.com/paultag/sniff
Last synced: 5 days ago
JSON representation
Dispatch TLS Connections based on SNI
- Host: GitHub
- URL: https://github.com/paultag/sniff
- Owner: paultag
- License: other
- Created: 2015-12-27T00:32:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-02-07T00:52:15.000Z (almost 5 years ago)
- Last Synced: 2025-01-03T05:16:05.827Z (12 days ago)
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 58
- Watchers: 3
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - paultag/sniff - Dispatch TLS Connections based on SNI (others)
- awesome-network-stuff - **31**星
README
sniff
=====SNIff is a small server that will accept incoming TLS connections, and parse
TLS Client Hello messages for the SNI Extension. If one is found, we'll go
ahead and forward that connection to a remote (or local!) host.sniff config
------------```json
{
"bind": {
"host": "localhost",
"port": 8443
},
"servers": [
{
"default": false,
"regexp": false,
"host": "97.107.130.79",
"names": [
"pault.ag",
"www.pault.ag"
],
"port": 443
}
]
}
```The following config will listen on port `8443`, and connect any requests
to `pault.ag` or `www.pault.ag` to port `443` on host `97.107.130.79`. If
nothing matches this, the socket will be closed.Changing default to true would send any unmatched hosts (or TLS / SSL connections
without SNI) to that host.By default, the requested domain name is compared literally with the strings
inside `names`. If `regexp` is true, then the names are interpreted as regular
expressions. Each server and name will be checked in the order they appear in
the file, stopping with the first match. If there is no match, then the
request is sent to the first server with `default` set.using the parser
----------------```
import (
"fmt""pault.ag/go/sniff/parser"
)func main() {
listener, err := net.Listen("tcp", "localhost:2222")
if err != nil {
return err
}
}
```