PageSourceSearch

https://xoilac-tv.sh/wp-content/plugins/soco-engine/assets/js/websocket-guard.js?ver=1.7.56-ws12

js xoilac-tv.sh collected 2026-10-10 02:44:21 UTC 1,972 bytes, 61 lines download raw bytes

1(function (window) {
2    'use strict';
3
4    var NativeWebSocket = window.WebSocket;
5    if (!NativeWebSocket || NativeWebSocket.__socoGuard) {
6        return;
7    }
8
9    function isDisabledLiveScoreSocket(url) {
10        if (typeof url !== 'string' || !url.trim()) {
11            return true;
12        }
13        try {
14            var parsed = new URL(url, window.location.href);
15            if (parsed.protocol !== 'ws:' && parsed.protocol !== 'wss:') {
16                return true;
17            }
18            return parsed.hostname.toLowerCase() === 'ws.sportdbc.com';
19        } catch (error) {
20            return true;
21        }
22    }
23
24    function stoppedSocket() {
25        var socket = {
26            readyState: NativeWebSocket.CLOSED,
27            bufferedAmount: 0,
28            protocol: '',
29            extensions: '',
30            binaryType: 'blob',
31            onopen: null,
32            onmessage: null,
33            onclose: null,
34            onerror: null,
35            send: function () {},
36            close: function () {},
37            addEventListener: function () {},
38            removeEventListener: function () {}
39        };
40        return socket;
41    }
42
43    function GuardedWebSocket(url, protocols) {
44        // ws.sportdbc.com no longer resolves. The Soco REST realtime poller
45        // remains active, so suppress only this dead legacy live-score socket.
46        if (isDisabledLiveScoreSocket(url)) {
47            return stoppedSocket();
48        }
49        return arguments.length > 1
50            ? new NativeWebSocket(url, protocols)
51            : new NativeWebSocket(url);
52    }
53
54    GuardedWebSocket.prototype = NativeWebSocket.prototype;
55    GuardedWebSocket.CONNECTING = NativeWebSocket.CONNECTING;
56    GuardedWebSocket.OPEN = NativeWebSocket.OPEN;
57    GuardedWebSocket.CLOSING = NativeWebSocket.CLOSING;
58    GuardedWebSocket.CLOSED = NativeWebSocket.CLOSED;
59    GuardedWebSocket.__socoGuard = true;
60    window.WebSocket = GuardedWebSocket;
61}(window));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.