devlinker 1.3.5__tar.gz → 1.3.7__tar.gz
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.
- devlinker-1.3.7/MANIFEST.in +3 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/PKG-INFO +1 -1
- devlinker-1.3.7/devlinker/devlinker_loader_instant.html +100 -0
- devlinker-1.3.7/devlinker/devlinker_loader_snippet.html +128 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/proxy.py +30 -4
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker.egg-info/PKG-INFO +1 -1
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker.egg-info/SOURCES.txt +3 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/pyproject.toml +1 -1
- devlinker-1.3.7/setup.py +9 -0
- devlinker-1.3.5/setup.py +0 -3
- {devlinker-1.3.5 → devlinker-1.3.7}/LICENSE +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/README.md +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/__init__.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/config.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/detection_state.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/detector.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/detector_ai.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/doctor.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/fix.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/fixer.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/global_state.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/inspect.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/logger.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/main.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/monitor.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/runner.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/share.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker/tunnel.py +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker.egg-info/dependency_links.txt +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker.egg-info/entry_points.txt +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker.egg-info/requires.txt +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/devlinker.egg-info/top_level.txt +0 -0
- {devlinker-1.3.5 → devlinker-1.3.7}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devlinker
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.7
|
|
4
4
|
Summary: A lightweight proxy that combines your frontend and backend into one link for easy development and sharing.
|
|
5
5
|
Author-email: Mani <mani1028@users.noreply.github.com>
|
|
6
6
|
Requires-Python: >=3.7
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<!-- DevLinker Instant Loader for Local/LAN Users -->
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Loading...</title>
|
|
8
|
+
<style>
|
|
9
|
+
#devlinker-loader-min {
|
|
10
|
+
position: fixed;
|
|
11
|
+
inset: 0;
|
|
12
|
+
z-index: 99999;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
align-items: center;
|
|
17
|
+
background: rgba(255,255,255,0.92);
|
|
18
|
+
min-height: 100vh;
|
|
19
|
+
font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
|
|
20
|
+
}
|
|
21
|
+
.devlinker-spinner-min {
|
|
22
|
+
width: 38px;
|
|
23
|
+
height: 38px;
|
|
24
|
+
border: 4px solid #e0e7ef;
|
|
25
|
+
border-top: 4px solid #2563eb;
|
|
26
|
+
border-radius: 50%;
|
|
27
|
+
animation: spin 1s linear infinite;
|
|
28
|
+
margin-bottom: 2.5rem;
|
|
29
|
+
}
|
|
30
|
+
@keyframes spin {
|
|
31
|
+
100% { transform: rotate(360deg); }
|
|
32
|
+
}
|
|
33
|
+
.devlinker-powered {
|
|
34
|
+
position: fixed;
|
|
35
|
+
bottom: 18px;
|
|
36
|
+
left: 0;
|
|
37
|
+
width: 100vw;
|
|
38
|
+
text-align: center;
|
|
39
|
+
color: #2563eb;
|
|
40
|
+
font-size: 1.08rem;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
opacity: 0.85;
|
|
43
|
+
letter-spacing: 0.01em;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
user-select: none;
|
|
46
|
+
z-index: 100000;
|
|
47
|
+
}
|
|
48
|
+
.devlinker-loading-msg {
|
|
49
|
+
font-size: 1.18rem;
|
|
50
|
+
color: #222;
|
|
51
|
+
font-weight: 500;
|
|
52
|
+
margin-top: -1.5rem;
|
|
53
|
+
margin-bottom: 2.2rem;
|
|
54
|
+
letter-spacing: 0.01em;
|
|
55
|
+
text-align: center;
|
|
56
|
+
opacity: 0.92;
|
|
57
|
+
}
|
|
58
|
+
.devlinker-3wev {
|
|
59
|
+
font-size: 1.05rem;
|
|
60
|
+
color: #2563eb;
|
|
61
|
+
font-weight: 600;
|
|
62
|
+
margin-top: 0.5rem;
|
|
63
|
+
letter-spacing: 0.04em;
|
|
64
|
+
text-align: center;
|
|
65
|
+
opacity: 0.93;
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
68
|
+
</head>
|
|
69
|
+
<body>
|
|
70
|
+
<div id="devlinker-loader-min">
|
|
71
|
+
<div class="devlinker-spinner-min"></div>
|
|
72
|
+
<div class="devlinker-loading-msg">Loading your app…</div>
|
|
73
|
+
</div>
|
|
74
|
+
<div class="devlinker-powered">Powered by DevLinker</div>
|
|
75
|
+
<script>
|
|
76
|
+
// Fetch the real page and replace the loader, but show loader for at least 1s
|
|
77
|
+
(async function() {
|
|
78
|
+
const minTime = 1000;
|
|
79
|
+
const start = Date.now();
|
|
80
|
+
try {
|
|
81
|
+
const resp = await fetch(window.location.href, { headers: { 'X-DevLinker-Instant': '1' } });
|
|
82
|
+
const html = await resp.text();
|
|
83
|
+
const elapsed = Date.now() - start;
|
|
84
|
+
const delay = Math.max(0, minTime - elapsed);
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
document.open();
|
|
87
|
+
document.write(html);
|
|
88
|
+
document.close();
|
|
89
|
+
}, delay);
|
|
90
|
+
} catch (e) {
|
|
91
|
+
// Show error if fetch fails
|
|
92
|
+
var loader = document.getElementById('devlinker-loader-min');
|
|
93
|
+
if (loader) {
|
|
94
|
+
loader.innerHTML += '<div style="color:#b91c1c;font-size:1.1rem;margin-top:1.5rem;">Failed to load app. Please check your connection.</div>';
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
})();
|
|
98
|
+
</script>
|
|
99
|
+
</body>
|
|
100
|
+
</html>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<!-- DevLinker Next-Level Loader Overlay -->
|
|
2
|
+
<style>
|
|
3
|
+
#devlinker-loader {
|
|
4
|
+
position: fixed;
|
|
5
|
+
z-index: 99999;
|
|
6
|
+
inset: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
min-height: 100vh;
|
|
11
|
+
background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ff 100%);
|
|
12
|
+
font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
|
|
13
|
+
transition: opacity 0.4s cubic-bezier(.4,0,.2,1);
|
|
14
|
+
}
|
|
15
|
+
.devlinker-loader-card {
|
|
16
|
+
background: #fff;
|
|
17
|
+
border-radius: 20px;
|
|
18
|
+
box-shadow: 0 15px 40px rgba(0,0,0,0.08);
|
|
19
|
+
padding: 40px 30px;
|
|
20
|
+
min-width: 260px;
|
|
21
|
+
max-width: 94vw;
|
|
22
|
+
text-align: center;
|
|
23
|
+
border: 1.5px solid #e0e7ef;
|
|
24
|
+
position: relative;
|
|
25
|
+
width: 100%;
|
|
26
|
+
max-width: 350px;
|
|
27
|
+
}
|
|
28
|
+
.devlinker-logo {
|
|
29
|
+
font-size: 2.1rem;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
color: #2563eb;
|
|
32
|
+
margin-bottom: 20px;
|
|
33
|
+
letter-spacing: -1.2px;
|
|
34
|
+
user-select: none;
|
|
35
|
+
}
|
|
36
|
+
.devlinker-spin {
|
|
37
|
+
margin: 20px auto;
|
|
38
|
+
width: 40px;
|
|
39
|
+
height: 40px;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
}
|
|
44
|
+
.devlinker-spinner {
|
|
45
|
+
width: 40px;
|
|
46
|
+
height: 40px;
|
|
47
|
+
border-radius: 50%;
|
|
48
|
+
border: 4px solid #e0e7ef;
|
|
49
|
+
border-top: 4px solid #3b82f6;
|
|
50
|
+
animation: devlinker-spin 1.1s linear infinite;
|
|
51
|
+
}
|
|
52
|
+
@keyframes devlinker-spin {
|
|
53
|
+
100% { transform: rotate(360deg); }
|
|
54
|
+
}
|
|
55
|
+
.devlinker-brand {
|
|
56
|
+
font-size: 1.13rem;
|
|
57
|
+
color: #222;
|
|
58
|
+
font-weight: 600;
|
|
59
|
+
margin-bottom: 0.2rem;
|
|
60
|
+
letter-spacing: -0.5px;
|
|
61
|
+
}
|
|
62
|
+
.devlinker-desc {
|
|
63
|
+
font-size: 1.01rem;
|
|
64
|
+
color: #555;
|
|
65
|
+
margin-bottom: 0.7rem;
|
|
66
|
+
}
|
|
67
|
+
.devlinker-upgrade-btn {
|
|
68
|
+
margin-top: 15px;
|
|
69
|
+
background: #2563eb;
|
|
70
|
+
color: #fff;
|
|
71
|
+
border: none;
|
|
72
|
+
padding: 8px 16px;
|
|
73
|
+
border-radius: 8px;
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
box-shadow: 0 2px 8px rgba(37,99,235,0.08);
|
|
78
|
+
transition: background 0.2s, box-shadow 0.2s;
|
|
79
|
+
outline: none;
|
|
80
|
+
display: inline-block;
|
|
81
|
+
}
|
|
82
|
+
.devlinker-upgrade-btn:hover {
|
|
83
|
+
background: #1d4ed8;
|
|
84
|
+
box-shadow: 0 4px 16px rgba(37,99,235,0.13);
|
|
85
|
+
}
|
|
86
|
+
@media (max-width: 600px) {
|
|
87
|
+
.devlinker-loader-card {
|
|
88
|
+
min-width: 0;
|
|
89
|
+
padding: 1.2rem 0.5rem 1.1rem 0.5rem;
|
|
90
|
+
border-radius: 12px;
|
|
91
|
+
}
|
|
92
|
+
.devlinker-logo {
|
|
93
|
+
font-size: 1.3rem;
|
|
94
|
+
}
|
|
95
|
+
.devlinker-upgrade-btn {
|
|
96
|
+
font-size: 0.97rem;
|
|
97
|
+
padding: 8px 12px;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
101
|
+
<div id="devlinker-loader">
|
|
102
|
+
<div class="devlinker-loader-card">
|
|
103
|
+
<div class="devlinker-logo">∞ DevLinker</div>
|
|
104
|
+
<div class="devlinker-spin"><div class="devlinker-spinner"></div></div>
|
|
105
|
+
<div class="devlinker-brand">Loading your app...</div>
|
|
106
|
+
<div class="devlinker-desc">Powered by <span style="color:#2563eb;font-weight:700;">DevLinker</span> 🚀</div>
|
|
107
|
+
<a href="https://devlinker.app" target="_blank" rel="noopener">
|
|
108
|
+
<button class="devlinker-upgrade-btn">Upgrade for custom domain</button>
|
|
109
|
+
</a>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<script>
|
|
113
|
+
const start = Date.now();
|
|
114
|
+
function hideLoader() {
|
|
115
|
+
const minTime = 1000; // 1 sec branding (increased from 0.8s)
|
|
116
|
+
const elapsed = Date.now() - start;
|
|
117
|
+
const delay = Math.max(0, minTime - elapsed);
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
const el = document.getElementById("devlinker-loader");
|
|
120
|
+
if (el) {
|
|
121
|
+
el.style.opacity = "0";
|
|
122
|
+
setTimeout(() => el.remove(), 400);
|
|
123
|
+
}
|
|
124
|
+
}, delay);
|
|
125
|
+
}
|
|
126
|
+
window.addEventListener("load", hideLoader);
|
|
127
|
+
setTimeout(hideLoader, 7000); // max 7s (increased from 5s)
|
|
128
|
+
</script>
|
|
@@ -142,6 +142,30 @@ def _build_target_ws_url(port: int, path: str, query: str) -> str:
|
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
async def _forward_http(request: Request) -> Response:
|
|
145
|
+
# Serve instant loader for local/LAN users unless X-DevLinker-Instant header is present
|
|
146
|
+
client_ip = request.client.host if request.client else None
|
|
147
|
+
def is_local_network(ip):
|
|
148
|
+
if not ip:
|
|
149
|
+
return False
|
|
150
|
+
if ip.startswith("127.") or ip == "localhost" or ip == "::1":
|
|
151
|
+
return False
|
|
152
|
+
if ip.startswith("192.168.") or ip.startswith("10."):
|
|
153
|
+
return True
|
|
154
|
+
if ip.startswith("172."):
|
|
155
|
+
try:
|
|
156
|
+
second = int(ip.split(".")[1])
|
|
157
|
+
return 16 <= second <= 31
|
|
158
|
+
except Exception:
|
|
159
|
+
return False
|
|
160
|
+
return False
|
|
161
|
+
is_local = is_local_network(client_ip)
|
|
162
|
+
is_instant = request.headers.get("x-devlinker-instant") == "1"
|
|
163
|
+
if is_local and not is_instant and request.method == "GET":
|
|
164
|
+
import os
|
|
165
|
+
loader_path = os.path.join(os.path.dirname(__file__), "devlinker_loader_instant.html")
|
|
166
|
+
with open(loader_path, encoding="utf-8") as f:
|
|
167
|
+
loader_html = f.read()
|
|
168
|
+
return Response(content=loader_html, status_code=200, media_type="text/html")
|
|
145
169
|
from devlinker.logger import print_warning, print_fix
|
|
146
170
|
from devlinker.detector_ai import DevLinkerAI
|
|
147
171
|
|
|
@@ -207,18 +231,20 @@ async def _forward_http(request: Request) -> Response:
|
|
|
207
231
|
for s in ai_suggestions:
|
|
208
232
|
print_fix(s)
|
|
209
233
|
|
|
210
|
-
# Only inject loader for HTML responses, not localhost
|
|
234
|
+
# Only inject loader for HTML responses, not localhost/loopback, but DO inject for LAN/WiFi clients
|
|
211
235
|
headers = _filter_response_headers(dict(upstream.headers))
|
|
212
236
|
content_type = headers.get("content-type", "")
|
|
213
237
|
is_html = "text/html" in content_type
|
|
214
|
-
is_public = not
|
|
238
|
+
is_public = client_ip and not is_local and (not client_ip.startswith("127.") and client_ip != "localhost" and client_ip != "::1")
|
|
215
239
|
content = upstream.content
|
|
216
|
-
if is_html and is_public:
|
|
240
|
+
if is_html and (is_local or is_public):
|
|
217
241
|
try:
|
|
218
242
|
html = content.decode(upstream.encoding or "utf-8", errors="replace")
|
|
219
243
|
# Only inject if </body> exists
|
|
220
244
|
if "</body>" in html:
|
|
221
|
-
|
|
245
|
+
import os
|
|
246
|
+
loader_file = "devlinker_loader_snippet.html"
|
|
247
|
+
with open(os.path.join(os.path.dirname(__file__), loader_file), encoding="utf-8") as f:
|
|
222
248
|
loader = f.read()
|
|
223
249
|
html = html.replace("</body>", loader + "</body>")
|
|
224
250
|
content = html.encode(upstream.encoding or "utf-8")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devlinker
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.7
|
|
4
4
|
Summary: A lightweight proxy that combines your frontend and backend into one link for easy development and sharing.
|
|
5
5
|
Author-email: Mani <mani1028@users.noreply.github.com>
|
|
6
6
|
Requires-Python: >=3.7
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
2
3
|
README.md
|
|
3
4
|
pyproject.toml
|
|
4
5
|
setup.py
|
|
@@ -7,6 +8,8 @@ devlinker/config.py
|
|
|
7
8
|
devlinker/detection_state.py
|
|
8
9
|
devlinker/detector.py
|
|
9
10
|
devlinker/detector_ai.py
|
|
11
|
+
devlinker/devlinker_loader_instant.html
|
|
12
|
+
devlinker/devlinker_loader_snippet.html
|
|
10
13
|
devlinker/doctor.py
|
|
11
14
|
devlinker/fix.py
|
|
12
15
|
devlinker/fixer.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "devlinker"
|
|
7
|
-
version = "1.3.
|
|
7
|
+
version = "1.3.7"
|
|
8
8
|
description = "A lightweight proxy that combines your frontend and backend into one link for easy development and sharing."
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Mani", email = "mani1028@users.noreply.github.com" }
|
devlinker-1.3.7/setup.py
ADDED
devlinker-1.3.5/setup.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|