Skip to content
Merged
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
8 changes: 8 additions & 0 deletions proxy/dokodemo/dokodemo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dokodemo

import (
"context"
"slices"
"strconv"
"strings"

Expand Down Expand Up @@ -56,6 +57,9 @@ func (d *DokodemoDoor) Init(config *Config, pm policy.Manager, sockopt *session.

// Network implements proxy.Inbound.
func (d *DokodemoDoor) Network() []net.Network {
if slices.Contains(d.config.Networks, net.Network_TCP) {
return append(d.config.Networks, net.Network_UNIX)
}
return d.config.Networks
}

Expand All @@ -68,6 +72,10 @@ func (d *DokodemoDoor) policy() policy.Session {
// Process implements proxy.Inbound.
func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn stat.Connection, dispatcher routing.Dispatcher) error {
errors.LogDebug(ctx, "processing connection from: ", conn.RemoteAddr())
// forward to TCP if from UNIX
if network == net.Network_UNIX {
network = net.Network_TCP
}
dest := net.Destination{
Network: network,
Address: d.address,
Expand Down