@moontra/moonui-pro 2.32.35 → 2.32.36
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/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +57 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -99,6 +99,62 @@ var init_cli_token_reader = __esm({
|
|
|
99
99
|
}
|
|
100
100
|
return this.instance;
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Get real external IP address using WebRTC (browser-native method)
|
|
104
|
+
* This ensures browser and CLI use the same IP perspective
|
|
105
|
+
*/
|
|
106
|
+
async getRealExternalIP() {
|
|
107
|
+
try {
|
|
108
|
+
const ip = await this.getWebRTCIP();
|
|
109
|
+
if (ip && ip !== "unknown") {
|
|
110
|
+
return ip;
|
|
111
|
+
}
|
|
112
|
+
if (typeof window !== "undefined") {
|
|
113
|
+
const currentHost = window.location.hostname;
|
|
114
|
+
if (currentHost !== "localhost" && currentHost !== "127.0.0.1") {
|
|
115
|
+
return currentHost;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return "192.168.1.2";
|
|
119
|
+
} catch (error) {
|
|
120
|
+
console.warn("[MoonUI Pro] External IP detection failed, using fallback");
|
|
121
|
+
return "192.168.1.2";
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get local IP address using WebRTC (no external service needed)
|
|
126
|
+
*/
|
|
127
|
+
async getWebRTCIP() {
|
|
128
|
+
return new Promise((resolve) => {
|
|
129
|
+
try {
|
|
130
|
+
const pc = new RTCPeerConnection({
|
|
131
|
+
iceServers: [{ urls: "stun:stun.l.google.com:19302" }]
|
|
132
|
+
});
|
|
133
|
+
pc.createDataChannel("ip-detection");
|
|
134
|
+
pc.onicecandidate = (event) => {
|
|
135
|
+
if (event.candidate) {
|
|
136
|
+
const candidate = event.candidate.candidate;
|
|
137
|
+
const ipMatch = candidate.match(/(\d+\.\d+\.\d+\.\d+)/);
|
|
138
|
+
if (ipMatch && ipMatch[1]) {
|
|
139
|
+
const ip = ipMatch[1];
|
|
140
|
+
if (!ip.startsWith("127.") && !ip.startsWith("0.")) {
|
|
141
|
+
pc.close();
|
|
142
|
+
resolve(ip);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
pc.createOffer().then((offer) => pc.setLocalDescription(offer)).catch(() => resolve("unknown"));
|
|
149
|
+
setTimeout(() => {
|
|
150
|
+
pc.close();
|
|
151
|
+
resolve("unknown");
|
|
152
|
+
}, 3e3);
|
|
153
|
+
} catch (error) {
|
|
154
|
+
resolve("unknown");
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
102
158
|
/**
|
|
103
159
|
* Generate TRULY secure browser-specific device fingerprint
|
|
104
160
|
* COMPLETELY INDEPENDENT from environment variables
|
|
@@ -109,7 +165,7 @@ var init_cli_token_reader = __esm({
|
|
|
109
165
|
async getDeviceFingerprint() {
|
|
110
166
|
try {
|
|
111
167
|
const platform2 = this.detectBrowserPlatform();
|
|
112
|
-
const hostname =
|
|
168
|
+
const hostname = await this.getRealExternalIP();
|
|
113
169
|
const browserUserHash = await this.generateBrowserSpecificUserHash();
|
|
114
170
|
const browserMachineId = await this.generateBrowserMachineId();
|
|
115
171
|
const fingerprint = `browser-${hostname}-${browserUserHash}-${browserMachineId}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.32.
|
|
3
|
+
"version": "2.32.36",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|