Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUIC matcher #262

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading