Skip to content

Commit

Permalink
readProxy setting
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Dec 13, 2024
1 parent fb84497 commit 9cf1af0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion net_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -5074,7 +5074,7 @@ static int processClient(struct client *c, int64_t now, struct messageBuffer *mb

if (now - c->connectedSince < 5 * SECONDS) {
// check for PROXY v1 header if connection is new / low bytes received
if (Modes.netIngest && c->som == c->buf) {
if ((Modes.netIngest || Modes.readProxy) && c->som == c->buf) {
if (c->eod - c->som >= 6 && c->som[0] == 'P' && c->som[1] == 'R') {
int res = readProxy(c);
if (res != 0) {
Expand Down
3 changes: 3 additions & 0 deletions readsb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2041,6 +2041,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
if (strcasecmp(token[0], "legacy_history") == 0) {
Modes.legacy_history = 1;
}
if (strcasecmp(token[0], "readProxy") == 0) {
Modes.readProxy = 1;
}
if (strcasecmp(token[0], "beast_forward_noforward") == 0) {
Modes.beast_forward_noforward = 1;
}
Expand Down
1 change: 1 addition & 0 deletions readsb.h
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ struct _Modes
int8_t netReceiverIdPrint;
int8_t netReceiverIdJson;
int8_t netIngest;
int8_t readProxy;
int8_t enableClientsJson;
int8_t forward_mlat; // forward beast mlat messages to beast output ports
int8_t forward_mlat_sbs; // forward mlat messages to sbs output ports
Expand Down

0 comments on commit 9cf1af0

Please sign in to comment.