File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -65,3 +65,35 @@ $response->send();
6565
6666```
6767
68+ Plugin Example
69+ --------
70+
71+ ``` php
72+ namespace Proxy\Plugin;
73+
74+ use Proxy\Plugin\AbstractPlugin;
75+ use Proxy\Event\ProxyEvent;
76+
77+ use Proxy\Html;
78+
79+ class MultiSiteMatchPlugin extends AbstractPlugin {
80+
81+ // Matches multiple domain names (abc.com, abc.de, abc.pl) using regex (you MUST use / character)
82+ protected $url_pattern = '/^abc\.(com|de|pl)$/is';
83+ // Matches a single domain name
84+ //protected $url_pattern = 'abc.com';
85+
86+ public function onCompleted(ProxyEvent $event){
87+
88+ $response = $event['response'];
89+
90+ $html = $response->getContent();
91+
92+ // do your stuff here...
93+
94+ $response->setContent($html);
95+ }
96+ }
97+ ```
98+
99+ Notice that you must use the ** /** character for regexes on ``` $url_pattern ```
You can’t perform that action at this time.
0 commit comments