-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-server.html
More file actions
153 lines (145 loc) · 5.21 KB
/
test-server.html
File metadata and controls
153 lines (145 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SOAP-REST Proxy Test</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 50px auto;
padding: 20px;
background: #f5f5f5;
}
.container {
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
h1 {
color: #333;
}
button {
background: #667eea;
color: white;
border: none;
padding: 12px 24px;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
margin: 10px 5px;
}
button:hover {
background: #5568d3;
}
.result {
margin-top: 20px;
padding: 15px;
border-radius: 4px;
font-family: monospace;
white-space: pre-wrap;
}
.success {
background: #d4edda;
border: 1px solid #c3e6cb;
color: #155724;
}
.error {
background: #f8d7da;
border: 1px solid #f5c6cb;
color: #721c24;
}
.info {
background: #d1ecf1;
border: 1px solid #bee5eb;
color: #0c5460;
}
.endpoint {
margin: 10px 0;
padding: 10px;
background: #f8f9fa;
border-left: 3px solid #667eea;
}
</style>
</head>
<body>
<div class="container">
<h1>🚀 SOAP-REST Proxy Server Test</h1>
<p>Click the buttons below to test the server connection:</p>
<div>
<button onclick="testEndpoint('http://localhost:3000/health')">Test localhost:3000</button>
<button onclick="testEndpoint('http://127.0.0.1:3000/health')">Test 127.0.0.1:3000</button>
<button onclick="testEndpoint('http://localhost:3000/api/hello')">Test API Endpoint</button>
<button onclick="testEndpoint('http://localhost:3000/admin/stats')">Test Admin Stats</button>
</div>
<div id="result"></div>
<h2>📝 Available Endpoints:</h2>
<div class="endpoint">
<strong>Health Check:</strong><br>
<a href="http://localhost:3000/health" target="_blank">http://localhost:3000/health</a>
</div>
<div class="endpoint">
<strong>Admin Stats:</strong><br>
<a href="http://localhost:3000/admin/stats" target="_blank">http://localhost:3000/admin/stats</a>
</div>
<div class="endpoint">
<strong>API Hello:</strong><br>
<a href="http://localhost:3000/api/hello" target="_blank">http://localhost:3000/api/hello</a>
</div>
<div class="endpoint">
<strong>Metrics (JSON):</strong><br>
<a href="http://localhost:3000/admin/metrics?format=json" target="_blank">http://localhost:3000/admin/metrics?format=json</a>
</div>
<h2>🔧 Troubleshooting:</h2>
<div class="info" style="margin-top: 10px;">
If you see CORS or connection errors:
<ul>
<li>Make sure the server is running (check console)</li>
<li>Try opening the links above in a new tab</li>
<li>Check Windows Firewall settings</li>
<li>Try using 127.0.0.1 instead of localhost</li>
</ul>
</div>
</div>
<script>
async function testEndpoint(url) {
const resultDiv = document.getElementById('result');
resultDiv.innerHTML = '<div class="info">Testing connection to: ' + url + '...</div>';
try {
const response = await fetch(url);
const data = await response.json();
resultDiv.innerHTML = `
<div class="success">
<strong>✅ Success!</strong><br>
<strong>Status:</strong> ${response.status} ${response.statusText}<br>
<strong>Response:</strong><br>
${JSON.stringify(data, null, 2)}
</div>
`;
} catch (error) {
resultDiv.innerHTML = `
<div class="error">
<strong>❌ Error:</strong><br>
${error.message}<br><br>
<strong>Possible causes:</strong>
<ul>
<li>Server is not running</li>
<li>Windows Firewall is blocking the connection</li>
<li>CORS policy blocking (try opening link in new tab)</li>
<li>Antivirus blocking port 3000</li>
</ul>
</div>
`;
}
}
// Auto-test on page load
window.addEventListener('load', () => {
setTimeout(() => {
testEndpoint('http://localhost:3000/health');
}, 500);
});
</script>
</body>
</html>