LMLPHP后院

服务还是自己的最靠谱,第三方服务一定会坏技术

maybe yes 发表于 2025-03-13 13:09

这次栽跟头了,倒在了第三方服务上,第三方的服务终究是靠不住的。

ifconfig.me 之前请求直接返回 IP,现在返回 HTML 文档。这是吃饱了撑的,还是流量大了做出来改变,总之,不靠谱!

让人蛋疼的事,页面的样式做的很丑还撑出框框外面来了,这实在是太不专业了。

<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="content-style-type" content="text/css" />
    <meta http-equiv="content-script-type" content="text/javascript" />
    <meta http-equiv="content-language" content="en" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta name="description" content="Get my IP Address" />
    <meta name="keywords" content="ip address ifconfig ifconfig.me" />
    <meta name="author" content="" />
    <link rel="shortcut icon" href="favicon.ico" />
    <link rel="canonical" href="https://ifconfig.me/" />
    <title>What Is My IP Address? - ifconfig.me</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="./static/styles/style.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
</head>

<body>
    <div id="ad_container">
        <div class="ad">
            Need a robust API to Geolocate IPs and fetch other crucial information? Try
            <a
                href="https://ipinfo.io/?utm_source=ifconfig.me&utm_medium=referral&utm_campaign=upsell_sister_sites">IPinfo.io</a>.
        </div>
    </div>

    <div id="container" class="clearfix">
        <div id="header">
            <table>
                <tr>
                    <td>
                        <h1><a href="http://ifconfig.me">What Is My IP Address? - ifconfig.me</a></h1>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <div id="plungins">
                            <div class="plungin" id="button_facebook">
                                <div id="fb-root"></div>
                                <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
                                <fb:like href="http://ifconfig.me/" send="false" layout="button_count" width="100"
                                    show_faces="true" font=""></fb:like>
                            </div>

                            <div class="plungin" id="button_twitter">
                                <a href="http://twitter.com/share" class="twitter-share-button"
                                    data-url="http://ifconfig.me/" data-text="What Is My IP Address? - ifconfig.me"
                                    data-count="horizontal"></a>
                                <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
                            </div>

                            <div class="plungin" id="button_plusone">
                                <!-- Place this tag where you want the +1 button to render -->
                                <g:plusone size="medium" href="http://ifconfig.me/"></g:plusone>
                                <!-- Place this render call where appropriate -->
                                <script type="text/javascript">
                                    (function () {
                                        var po = document.createElement('script');
                                        po.type = 'text/javascript';
                                        po.async = true;
                                        po.src = 'https://apis.google.com/js/plusone.js';
                                        var s = document.getElementsByTagName('script')[0];
                                        s.parentNode.insertBefore(po, s);
                                    })();
                                </script>
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="info_area">
            <h2>Your Connection</h2>
            <table id="info_table" summary="info">
                <tr>
                    <td class="info_table_label">IP Address</td>
                    <td id="ip_address_cell"><strong id="ip_address">
                            xxx.xxx
                        </strong></td>
                </tr>
                <tr>
                    <td class="info_table_label">User Agent</td>
                    <td>
                        Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
                    </td>
                </tr>
                <tr>
                    <td class="info_table_label">Language</td>
                    <td>
                        en
                    </td>
                </tr>
                <tr>
                    <td class="info_table_label">Referer</td>
                    <td>
                        
                    </td>
                </tr>
                <tr>
                    <td class="info_table_label">Method</td>
                    <td>
                        GET
                    </td>
                </tr>
                <tr>
                    <td class="info_table_label">Encoding</td>
                    <td>
                        gzip, deflate, br
                    </td>
                </tr>
                <tr>
                    <td class="info_table_label">MIME Type</td>
                    <td>
                        text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
                    </td>
                </tr>
                <tr>
                    <td class="info_table_label">Charset</td>
                    <td>
                        
                    </td>
                </tr>
                <tr>
                    <td class="info_table_label">X-Forwarded-For</td>
                    <td>
                        xxx.xxx,34.160.111.145
                    </td>
                </tr>
            </table>
        </div>
        <!--<div id="middle"></div>-->
        <div id="cli_wrap">
            <h2>Command Line Interface</h2>
            <table id="cli_table" summary="cli">
                <tr>
                    <td class="cli_command">$ curl ifconfig.me</td>
                    <td class="cli_arrow">&rArr;</td>
                    <td>
                        xxx
                    </td>
                </tr>
                <tr>
                    <td class="cli_command">$ curl ifconfig.me/ip</td>
                    <td class="cli_arrow">&rArr;</td>
                    <td>
                        xxx
                    </td>
                </tr>
                <tr>
                    <td class="cli_command">$ curl ifconfig.me/ua</td>
                    <td class="cli_arrow">&rArr;</td>
                    <td>
                        Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
                    </td>
                </tr>
                <tr>
                    <td class="cli_command">$ curl ifconfig.me/lang</td>
                    <td class="cli_arrow">&rArr;</td>
                    <td>
                        en
                    </td>
                </tr>
                <tr>
                    <td class="cli_command">$ curl ifconfig.me/encoding</td>
                    <td class="cli_arrow">&rArr;</td>
                    <td>
                        gzip, deflate, br
                    </td>
                </tr>
                <tr>
                    <td class="cli_command">$ curl ifconfig.me/mime</td>
                    <td class="cli_arrow">&rArr;</td>
                    <td>
                        text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
                    </td>
                </tr>
                <tr>
                    <td class="cli_command">$ curl ifconfig.me/charset</td>
                    <td class="cli_arrow">&rArr;</td>
                    <td>
                        
                    </td>
                </tr>
                <tr>
                    <td class="cli_command">$ curl ifconfig.me/forwarded</td>
                    <td class="cli_arrow">&rArr;</td>
                    <td>
                        xxx,34.160.111.145
                    </td>
                </tr>
                <tr>
                    <td class="cli_command">$ curl ifconfig.me/all</td>
                    <td class="cli_arrow">&rArr;</td>
                    <td>
                        
                            ip_addr: xxx
                            <br>
                        
                            remote_host: unavailable
                            <br>
                        
                            user_agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
                            <br>
                        
                            port: 40220
                            <br>
                        
                            language: en
                            <br>
                        
                            referer: 
                            <br>
                        
                            connection: 
                            <br>
                        
                            keep_alive: 
                            <br>
                        
                            method: GET
                            <br>
                        
                            encoding: gzip, deflate, br
                            <br>
                        
                            mime: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
                            <br>
                        
                            charset: 
                            <br>
                        
                            via: 1.1 google
                            <br>
                        
                            forwarded: xxx,34.160.111.145
                            <br>
                        
                            
                            <br>
                        
                    </td>
                </tr>
                <tr>
                    <td class="cli_command">$ curl ifconfig.me/all.json</td>
                    <td class="cli_arrow">&rArr;</td>
                    <td>
                        {&quot;ip_addr&quot;:&quot;xxx&quot;,&quot;user_agent&quot;:&quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36&quot;,&quot;port&quot;:&quot;40220&quot;,&quot;method&quot;:&quot;GET&quot;,&quot;encoding&quot;:&quot;gzip, deflate, br&quot;,&quot;mime&quot;:&quot;text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7&quot;,&quot;via&quot;:&quot;1.1 google&quot;,&quot;forwarded&quot;:&quot;xxx,34.160.111.145&quot;,&quot;language&quot;:&quot;en&quot;}
                    </td>
                </tr>

            </table>
        </div>
        <div id="footer">&copy; 2024 ifconfig.me</div>
    </div>
</body>

</html>
2025-03-13 18:12:06 1741860726 0.014569