Add an optional POST parameter to the request API for IP addresses
https://github.com/AzuraCast/AzuraCast/issues/1008
"The StationRequestRepository has the functionality to throttle requests by IP addresses. This feature is only available when using the built-in request form of AzuraCast. When submitting requests via the API this feature is not usable.
I'd like to be able to optionally submit an IP address as a POST parameter to the API so that external applications can make use of this feature, too."
Comments: 3
-
24 Mar, '20
Alexander Horner MergedRequests submitted via the API, when authenticated, will respect the X-Forwarded-For as the requesting IP address, not bypassing rate limits for said IP address but bypassing them for the originating server.
-
27 Oct, '23
Mike Johnston MergedI agree this is a bug but it doesn't seem worked on. So in my setup, I added the following code to the index.php file, just below the error error configs and above the $app init.
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$xff_ip = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $xff_ip[0];
}
All it does is take the proxy IP and tell PHP that its the remote address. Tested from a few different IPs and it works as expected. -
17 Jan
Buster Neece Admin"X-Forwarded-For on Requests" (suggested by <Hidden> on 2020-03-24), including upvotes (3) and comments (1), was merged into this suggestion.