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 CHANGED
@@ -1,3 +1,6 @@
1
+ V1.0.4
2
+ - Removed DNS Spoofing for testing
3
+
1
4
  V1.0.2
2
5
  - Wildcard topics for pub / sub fixes
3
6
  - Unit tests added for wildcard pattern matching
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relayx-webjs",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "A powerful library for integrating real-time communication into your webapps, powered by the Relay Network.",
5
5
  "main": "realtime/realtime.js",
6
6
  "type": "module",
@@ -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 ? [
@@ -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
- }