<!DOCTYPE html>
<html>
<head>
    <title>Reverse Proxy</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <style>
        body {
            margin: 0;
            padding: 0;
        }
        iframe {
            width: 100%;
            height: 100vh;
            border: none;
        }
    </style>
</head>
<body>
    <h1 id="title"></h1>
    <iframe id="proxyFrame" src="https://idc.0vun.cn"></iframe>
<pre><code>&lt;script&gt;
    $(document).ready(function () {
        var proxyFrame = document.getElementById('proxyFrame');
        var proxyWindow = proxyFrame.contentWindow || proxyFrame.contentDocument.document || proxyFrame.contentDocument;
        
        $(window).on('message', function (event) {
            var message = event.originalEvent.data;
            
            if (message.type === 'proxy') {
                var url = message.url;
                proxyWindow.location.href = url;
            }
        });

        proxyFrame.onload = function() {
            var title = proxyFrame.contentWindow.document.title;
            $('#title').text(title);
        };
    });
&lt;/script&gt;
</code></pre>
</body>
</html>
!DOCTYPE htmlhtmlhead titleReverse Proxytitle meta name=viewport content=width=device-width initial-scale=1 script src=httpscodejquerycomjquery-360minjsscript style body

原文地址: https://www.cveoy.top/t/topic/i9Bc 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录