jenssegers / jenssegers/php-proxy

Urls not redirected.

Open
#96 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
938
Forks
261
PR merge metrics
No merged PRs in 30d

Description

This example of code makes the page load correctly from the "proxy" but all the urls inside the html are the original and not the proxy.

```
filter(new RemoveEncodingFilter());
try
{
// Forward the request and get the response.
$response = $proxy->forward($request)->to('https://ouvir.radioamorportugal.com');
// Output response to the browser.
(new Laminas\HttpHandlerRunner\Emitter\SapiEmitter)->emit($response);
} catch(\GuzzleHttp\Exception\BadResponseException $e) {
// Correct way to handle bad responses
(new Laminas\HttpHandlerRunner\Emitter\SapiEmitter)->emit($e->getResponse());
}

```
Example response:
```

Webplayer - Radio amor Portugal

....
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.