host2gateway is a tool designed to provide access from a web server (Gateway) to a client without requiring static IP addresses, port forwarding, changing firewall rules, or other complex configurations. It is written in PHP and can be deployed on most hosting provider environments.
Note: The
developbranch serves as the main integration branch for ongoing development. All feature branches should be merged into dev via pull requests. Direct pushes to this branch are restricted. After thorough testing and review, dev will be merged intomasterbranch for production releases.
- No need for static IP or port forwarding: No modifications to your firewall or router settings are required.
- Platform-independent: Works anywhere PHP 8.2 or higher is supported, making it suitable for most shared hosting services.
- Lightweight and simple: Minimal dependencies and easy deployment.
- Strong encryption built-in: Uses RSA encryption to secure all communication, even if SSL/TLS is not available on the hosting provider. Your data is protected at all times, regardless of your environment.
The client establishes an outbound connection to a Gateway server that is accessible from the internet (a PHP-enabled web host). Both sides communicate through this middleman Gateway, effectively bypassing usual restrictions imposed by NAT, firewalls, and the absence of static IPs.
- Upload the
host2gateway/hostdirectory to your internet-accessible host or hosting provider. - Copy the
host2gateway/clientdirectory to your local web server. - Configure the client and server to connect and communicate with the Gateway. Simply open
http://localhost/host2gateway/client/client.phpin a browser or use curl to receive instructions. - Access your client securely and easily from anywhere via the Gateway server.
Note: No need to configure UPnP, request a static IP, use port forwarding, or make changes to your firewall. All you need is PHP and a compatible server!
- PHP (version 8.2 or newer required)
- A web server (such as Apache or Nginx), or any hosting environment supporting PHP and SQLite
- A cron job or similar scheduler on the local computer
-
Download or clone the repository:
git clone https://github.com/ProfiDE/host2gateway.git
-
Upload the
hostdirectory to your hosting provider. -
On your local machine (the client), configure and run the provided
client.phpscript. -
Transfer the client's public key to the
hostdirectory on the server and rename it toclient.pem. -
Set up a cron job on the client machine to run client.php every minute. Example:
* * * * * php /path/to/host2gateway/client/client.php
- All communications are protected by a robust encryption mechanism, which secures traffic even if the server does not provide SSL/TLS.
- Ensure the client's public key is transferred to the server securely until setup is complete. This is important to prevent man-in-the-middle (MITM) attacks.
- Avoid exposing private data unnecessarily.
This project is released under the MIT License.
Pull requests and suggestions are welcome! For major changes, please open an issue first to discuss what you would like to change.
host2gateway is provided for legitimate and ethical use cases only. The developers assume no responsibility for any misuse or illegal activities carried out with this tool. It is the user's responsibility to comply with all applicable laws, regulations, and hosting provider terms of service. Unauthorized or malicious use may violate laws in your jurisdiction and could result in account suspension, legal penalties, or other consequences.
By using this tool, you agree to use it responsibly and exclusively for lawful purposes. The developers and maintainers disclaim any liability for damages, loss of data, security breaches, or other issues resulting from the use or misuse of host2gateway. You are solely responsible for securing your deployments and data.
