This is a simple library/project to create proxy-service just having PHP and a web-server. That is, there is no need to install any other software.
This project includes code to implement the client and server. Everything is done in PHP language. But you can implement your own client in any programming language and use the server that is included with this project.
When might you need this project? For research and practical purposes, bypassing blocking and restrictions on websites or services from which you want to obtain data (to parse pages or access to restricted APIs). For example, in such cases of use:
- To send requests to services and websites that are blocked in your country, for example,
api.telegram.org. When the blocking is so severe that requests do not pass through regular proxies such as SOCKS5. - When you have limited resources for your pet project and want to make do with free or super cheap shared hosting that doesn't have the ability to install regular HTTP/SOCKS proxy-server.
- Is this approach suitable for production use? Yes, but not for high loads, which also require maximum proxy-service speed. Meeting these high load and speed requirements requires customization and configuration of additional software. However, another solution is better suited for this purpose.
- PHP >= 5.6
- Apache 2. You can use another web-server, but security rules are currently only was made for Apache (via
.htaccess). You should not ignore these security rules.
- Go to your web directory on your web-server, for example,
cd /var/www/ git clone https://github.com/zapalm/request-proxy.gitcd request-proxycomposer installcp examples/1/test-api.php api.php(api.phpfile is the entry point to your proxy service)nano api.phpand then edit the path to thevendordirectory and specify your accesstoken
- Add the dependency directly to your
composer.jsonfile of your project:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/zapalm/request-proxy"
}
],
"require": {
"php": ">=5.6",
"zapalm/request-proxy": "dev-master"
},
composer update- Finally, write the client code to work with your
request-proxyservice using the example intests/TestRequestProxy.php.
Update your server code periodically:
cd request-proxy
git pull
composer update
Give the star to the project. That's all! :)
Contributors must follow the following rules:
- Make your Pull Request on the dev branch, NOT the master branch.
- Follow PSR coding standards.
Contributors wishing to edit the project's files should follow the following process:
- Create your GitHub account, if you do not have one already.
- Fork the project to your GitHub account.
- Clone your fork to your local machine.
- Create a branch in your local clone of the project for your changes.
- Change the files in your branch. Be sure to follow the coding standards.
- Push your changed branch to your fork in your GitHub account.
- Create a pull request for your changes on the dev branch of the project. If you need help to make a pull request, read the GitHub help page about creating pull requests.
- Wait for the maintainer to apply your changes.
Do not hesitate to create a pull request if even it's hard for you to apply the coding standards.