Skip to content

Commit

Permalink
QUIC matcher: initial commit (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
vnxme authored Oct 31, 2024
1 parent 16b3b20 commit 6e8e058
Show file tree
Hide file tree
Showing 5 changed files with 544 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Current matchers:
- **layer4.matchers.openvpn** - matches connections that look like [OpenVPN](https://openvpn.net/community-resources/openvpn-protocol/) connections.
- **layer4.matchers.postgres** - matches connections that look like Postgres connections.
- **layer4.matchers.proxy_protocol** - matches connections that start with [HAPROXY proxy protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt).
- **layer4.matchers.quic** - matches connections that look like [QUIC](https://quic.xargs.org/).
- **layer4.matchers.rdp** - matches connections that look like [RDP](https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-RDPBCGR/%5BMS-RDPBCGR%5D.pdf).
- **layer4.matchers.regexp** - matches connections that have the first packet bytes matching a regular expression.
- **layer4.matchers.remote_ip** - matches connections based on remote IP (or CIDR range).
Expand Down
1 change: 1 addition & 0 deletions imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
_ "github.com/mholt/caddy-l4/modules/l4postgres"
_ "github.com/mholt/caddy-l4/modules/l4proxy"
_ "github.com/mholt/caddy-l4/modules/l4proxyprotocol"
_ "github.com/mholt/caddy-l4/modules/l4quic"
_ "github.com/mholt/caddy-l4/modules/l4rdp"
_ "github.com/mholt/caddy-l4/modules/l4regexp"
_ "github.com/mholt/caddy-l4/modules/l4socks"
Expand Down
83 changes: 83 additions & 0 deletions integration/caddyfile_adapt/gd_matcher_quic.caddytest
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
layer4 {
udp/:8843 {
@q1 quic sni one.com two.com
route @q1 {
proxy udp/{l4.quic.tls.server_name}:443
}
@q2 quic {
alpn custom
sni example.com
}
route @q2 {
proxy udp/localhost:6543
}
}
}
}
----------
{
"apps": {
"layer4": {
"servers": {
"srv0": {
"listen": [
"udp/:8843"
],
"routes": [
{
"match": [
{
"quic": {
"sni": [
"one.com",
"two.com"
]
}
}
],
"handle": [
{
"handler": "proxy",
"upstreams": [
{
"dial": [
"udp/{l4.quic.tls.server_name}:443"
]
}
]
}
]
},
{
"match": [
{
"quic": {
"alpn": [
"custom"
],
"sni": [
"example.com"
]
}
}
],
"handle": [
{
"handler": "proxy",
"upstreams": [
{
"dial": [
"udp/localhost:6543"
]
}
]
}
]
}
]
}
}
}
}
}
Loading

0 comments on commit 6e8e058

Please sign in to comment.