Skip to content

Commit

Permalink
Merge pull request #276 from Castaglia/proxy-opts-allowforeignaddress…
Browse files Browse the repository at this point in the history
…-issue275

Issue #275: Implement a new AllowForeignAddress ProxyOption, for mana…
  • Loading branch information
Castaglia authored Jun 29, 2024
2 parents 05961ee + adf5460 commit 8c2e19e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mod_proxy.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ProFTPD - mod_proxy
* Copyright (c) 2012-2023 TJ Saunders
* Copyright (c) 2012-2024 TJ Saunders
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -811,6 +811,9 @@ MODRET set_proxyoptions(cmd_rec *cmd) {
} else if (strcmp(cmd->argv[i], "IgnoreConfigPerms") == 0) {
opts |= PROXY_OPT_IGNORE_CONFIG_PERMS;

} else if (strcmp(cmd->argv[i], "AllowForeignAddress") == 0) {
opts |= PROXY_OPT_ALLOW_FOREIGN_ADDRESS;

} else {
CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, ": unknown ProxyOption '",
(char *) cmd->argv[i], "'", NULL));
Expand Down
1 change: 1 addition & 0 deletions mod_proxy.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
#define PROXY_OPT_IGNORE_CONFIG_PERMS 0x0010
#define PROXY_OPT_USE_PROXY_PROTOCOL_V2 0x0020
#define PROXY_OPT_USE_PROXY_PROTOCOL_V2_TLVS 0x0040
#define PROXY_OPT_ALLOW_FOREIGN_ADDRESS 0x0080

/* mod_proxy datastores */
#define PROXY_DATASTORE_SQLITE 1
Expand Down
15 changes: 15 additions & 0 deletions mod_proxy.html
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,21 @@ <h3><a name="ProxyOptions">ProxyOptions</a></h3>
<p>
The currently implemented options are:
<ul>
<li><code>AllowForeignAddress</code><br>
<p>
The <a href="http://www.proftpd.org/docs/modules/mod_core.html#AllowForeignAddress"><code>AllowForeignAddress</code></a> directive controls the policy for
<i>frontend</i> data transfer requests from clients connecting to the proxy
server; it does <b>not</b> apply to <i>backend</i> data transfer requests.
For those, you will want to use this <code>AllowForeignAddress</code>
option:
<pre>
# Allow for cases where the backend server tells us to use a different IP
# address for data transfers than the IP address to which mod_proxy connected.
ProxyOptions AllowForeignAddress
</pre>
</li>

<p>
<li><code>ShowFeatures</code><br>
<p>
When reverse proxying, <code>mod_proxy</code> defaults to not responding to
Expand Down

0 comments on commit 8c2e19e

Please sign in to comment.