relayx-webjs 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/package.json +1 -1
- package/realtime/realtime.js +0 -2
- package/realtime/dns_change.js +0 -20
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/realtime/realtime.js
CHANGED
|
@@ -2,7 +2,6 @@ import { connect, JSONCodec, Events, DebugEvents, AckPolicy, ReplayPolicy, creds
|
|
|
2
2
|
import { DeliverPolicy, jetstream } from "@nats-io/jetstream";
|
|
3
3
|
import { encode, decode } from "@msgpack/msgpack";
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
|
-
import { initDNSSpoof } from "./dns_change.js";
|
|
6
5
|
|
|
7
6
|
export class Realtime {
|
|
8
7
|
|
|
@@ -118,7 +117,6 @@ export class Realtime {
|
|
|
118
117
|
|
|
119
118
|
if(process.env.PROXY){
|
|
120
119
|
this.#baseUrl = ["wss://api2.relay-x.io:8666"];
|
|
121
|
-
initDNSSpoof();
|
|
122
120
|
}else{
|
|
123
121
|
if (staging !== undefined || staging !== null){
|
|
124
122
|
this.#baseUrl = staging ? [
|
package/realtime/dns_change.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import dns from 'node:dns';
|
|
2
|
-
|
|
3
|
-
export function initDNSSpoof(){
|
|
4
|
-
const originalLookup = dns.lookup;
|
|
5
|
-
|
|
6
|
-
// Override for the whole process
|
|
7
|
-
dns.lookup = function patchedLookup(hostname, options, callback) {
|
|
8
|
-
|
|
9
|
-
// ── Our one special case ──────────────────────────────────
|
|
10
|
-
if (hostname === 'api2.relay-x.io') {
|
|
11
|
-
// Map to loop‑back; family 4 avoids ::1
|
|
12
|
-
return process.nextTick(() =>
|
|
13
|
-
callback(null, [{address: '127.0.0.1', family: 4}])
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Anything else → real DNS
|
|
18
|
-
return originalLookup.call(dns, hostname, options, callback);
|
|
19
|
-
};
|
|
20
|
-
}
|