Skip to content
Example code that demponstrates how to write a simple proxy using PSR-7 HTTP message objects.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

PHP PSR-7 Proxy

Some example code that demonstrates how to write a simple proxy using PSR-7 http message objects.

See this blog post for more info.


Run the example:

php -S localhost:8080 web/proxy.php

Then use CURL, Postman, or your favourite API testing tool to run some requests. The example code proxies connections to the JSONPlaceholder fake API.

So instead of /posts you can try /posts. Or, instead of /posts?userId=1 you can use /posts?userId=1.


WTFPL "The WTFPL is a very permissive license for software and other scientific or artistic works that offers a great degree of freedom. In fact, it is probably the best license out there."

You can’t perform that action at this time.