Download the PHP package wakeworks/requestproxy without Composer
On this page you can find all versions of the php package wakeworks/requestproxy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wakeworks/requestproxy
More information about wakeworks/requestproxy
Files in wakeworks/requestproxy
Package requestproxy
Short Description Silverstripe 5 module allowing you to proxy requests from your visitors to other servers
License BSD-3-Clause
Informations about the package requestproxy
RequestProxy for Silverstripe 5
Introduction
RequestProxy allows you to route a user's request through your server.
Imagine you want to use fonts from Adobe Typekit but your data protection officer tells you: "No communication to US companies under GDPR". Adobe doesn't allow self-hosting, so you can't use it normally. However, you could proxy the user's request through your server and return the font to the user without revealing their IP address.
Requirements
- silverstripe/framework ^5.0
- php-curl extension
Installation
Basic Configuration
Your links will now be available under /_requestproxy/link1
and /_requestproxy/link2
.
Usage
Templates
In Templates, use $RequestProxy(link1)
to get the link
Requirements
Advanced Configuration
Normally, RequestProxy will forward the Content-Type header and the returned HTTP status code. You can, however, force other ones.
Rate Limiting
Proxying requests can be dangerous, e.g. users could in theory make you DDoS the target service.
RequestProxy implements Silverstripe's RateLimitMiddleware to counter that. It allows 10 requests per link per minute as default value. If you want to change that value, you can change its configuration:
Extension Hooks
There are some extension hooks provided.
updateResponse($response)
inWakeWorks\RequestProxy\Controllers\RequestProxyController
allows you to change the response of the default /_requestproxy controller.updateCurlOptions($curl)
inWakeWorks\RequestProxy\RequestProxy
allows you to add more or change options in the $curl object.updateCurlResponseData($curl, $data)
allows you to add data from $curl into $data that is returned byRequestProxy::make_request