No description
Find a file
Kumi dc49da70d3
feat: migrate index.html to PHP for dynamic IP endpoints
Migrated index.html to index.php to enable dynamic generation of IPv4 and IPv6 endpoints based on the server's domain. This change facilitates the embedding of IP address information via iframe elements, enhancing flexibility and ensuring that the correct IP endpoints are utilized.
2024-09-18 10:00:03 +02:00
endpoint feat: Launch MyIP.Coffee web service 2024-04-12 19:52:23 +02:00
index.php feat: migrate index.html to PHP for dynamic IP endpoints 2024-09-18 10:00:03 +02:00
LICENSE feat: Launch MyIP.Coffee web service 2024-04-12 19:52:23 +02:00
README.md feat(readme): add donation badge and clarify hosting 2024-04-24 08:05:33 +02:00
script.js feat: dynamic IP service domain resolution 2024-04-24 08:08:57 +02:00
style.css feat: Launch MyIP.Coffee web service 2024-04-12 19:52:23 +02:00

MyIP.Coffee

Support us on private.coffee!

MyIP.Coffee is a simple web service that returns the IP address of the client making the request.

Setup

There are two components to this project, the website and the endpoint that returns the IP address.

The endpoint runs on https://ipv4.myip.coffee and https://ipv6.myip.coffee. The IPv4 endpoint only has an A record, while the IPv6 endpoint has both only an AAAA record.

nginx

If you use nginx, you don't need the endpoint. You can use the following configuration to return the IP address of the client:

server {
    listen 80;
    listen [::]:80;

    server_name ipv4.myip.coffee ipv6.myip.coffee;

    location / {
        return 200 "$remote_addr";
    }
}

PHP

As our web hosting solution comes with Apache and PHP, there is a PHP script in endpoint/index.php that just returns the IP address of the client. It is trivial to implement this in other languages, so this is left as an exercise to the reader.

License

This project is licensed under the MIT License - see the LICENSE file for details.