Skip to content
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
2 changes: 1 addition & 1 deletion gatewayd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ loggers:
# Implementing file output
# file : ./logs/gatewayd.log
level: "debug" # panic, fatal, error, warn, info, debug, trace
noColor: True
noColor: False
timeFormat: "unix"

clients:
Expand Down
2 changes: 1 addition & 1 deletion gatewayd_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins:
# Plugin name
- name: gatewayd-plugin-test
# whether to enable or disable the plugin on the next run
enabled: True
enabled: False
# path to the plugin's binary file
localPath: ../gatewayd-plugin-test/gatewayd-plugin-test
# Pass cmdline args to the plugin
Expand Down
28 changes: 27 additions & 1 deletion network/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,33 @@ func (pr *Proxy) PassThrough(gconn gnet.Conn) *gerr.GatewayDError {
// TODO: Implement OnTrafficToClient hooks.

// Send the response to the client.
return sendTrafficToClient(response, received)
errVerdict := sendTrafficToClient(response, received)

// Run the OnTrafficToClient hooks.
_, err = pr.hookConfig.Run(
context.Background(),
trafficData(
gconn,
client,
[]Field{
{
Name: "request",
Value: request,
},
{
Name: "response",
Value: response[:received],
},
},
err,
),
hook.OnTrafficToClient,
pr.hookConfig.Verification)
if err != nil {
pr.logger.Error().Err(err).Msg("Error running hook")
}

return errVerdict
}

// IsHealty checks if the pool is exhausted or the client is disconnected.
Expand Down