Skip to content

Commit 126da91

Browse files
Updates
1 parent d3d6fa0 commit 126da91

File tree

8 files changed

+71
-14
lines changed

8 files changed

+71
-14
lines changed

.github/skills/validate-devproxy-sample/SKILL.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,30 @@ Acceptable curl when:
215215
- Single request/response
216216
- Quick verification
217217

218+
### 10. URL Domain Validation
219+
220+
**Check**: Do URLs use proxy-friendly domains?
221+
222+
**Avoid these TLDs** — they're often excluded from system proxy settings:
223+
- `.local` — Reserved for mDNS/Bonjour, typically bypasses proxy
224+
- `.localhost` — Loopback, excluded by most systems
225+
- `.internal` — Often excluded in enterprise environments
226+
- `.test` — Reserved TLD, may have issues
227+
228+
**Use instead:**
229+
- `.contoso.com` — Microsoft's example domain (safe, won't resolve)
230+
- `.example.com` — IANA reserved for documentation
231+
- `.fabrikam.com` — Another Microsoft example domain
232+
- Real API domains you're mocking
233+
234+
**Why this matters**: When browsers/apps detect `.local` domains, they often skip the proxy entirely, making Dev Proxy unable to intercept requests.
235+
236+
**Check in files:**
237+
- `urlsToWatch` in `devproxyrc.json`
238+
- `baseUrl` in CRUD API files
239+
- API URLs in frontend code (JavaScript, HTML)
240+
- Mock response URLs
241+
218242
## Common Mistakes Summary
219243

220244
| Mistake | How to Fix |
@@ -230,6 +254,7 @@ Acceptable curl when:
230254
| curl without proxy | Add `-ikx http://127.0.0.1:8000` |
231255
| Wrong schema type | Match schema to file purpose |
232256
| Missing tracking pixel | Add at end of README |
257+
| Using `.local` TLD | Change to `.contoso.com` or similar |
233258

234259
## Validation Script
235260

@@ -281,4 +306,5 @@ Before creating a PR:
281306
8. [ ] curl commands include proxy flag
282307
9. [ ] README has tracking pixel
283308
10. [ ] Badge version matches PROXY VERSION
284-
11. [ ] VS Code shows no Problems
309+
11. [ ] URLs don't use `.local` or other excluded TLDs
310+
12. [ ] VS Code shows no Problems
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.1.0/mockresponseplugin.mocksfile.schema.json",
3+
"mocks": [
4+
{
5+
"request": {
6+
"url": "https://api.contoso.com/*",
7+
"method": "OPTIONS"
8+
},
9+
"response": {
10+
"statusCode": 204,
11+
"headers": [
12+
{ "name": "Access-Control-Allow-Origin", "value": "*" },
13+
{ "name": "Access-Control-Allow-Methods", "value": "GET, POST, PATCH, DELETE, OPTIONS" },
14+
{ "name": "Access-Control-Allow-Headers", "value": "Content-Type, x-api-key" },
15+
{ "name": "Access-Control-Max-Age", "value": "86400" }
16+
]
17+
}
18+
}
19+
]
20+
}

samples/full-stack-no-backend/.devproxy/devproxyrc.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/rc.schema.json",
2+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.1.0/rc.schema.json",
33
"plugins": [
4+
{
5+
"name": "MockResponsePlugin",
6+
"enabled": true,
7+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
8+
"configSection": "corsPlugin"
9+
},
410
{
511
"name": "LatencyPlugin",
612
"enabled": true,
@@ -26,15 +32,19 @@
2632
}
2733
],
2834
"urlsToWatch": [
29-
"https://api.tasks.local/*"
35+
"https://api.contoso.com/*"
3036
],
37+
"corsPlugin": {
38+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.1.0/mockresponseplugin.schema.json",
39+
"mocksFile": "cors-mocks.json"
40+
},
3141
"latencyPlugin": {
32-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/latencyplugin.schema.json",
42+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.1.0/latencyplugin.schema.json",
3343
"minMs": 200,
3444
"maxMs": 800
3545
},
3646
"authPlugin": {
37-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/authplugin.schema.json",
47+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.1.0/authplugin.schema.json",
3848
"type": "apiKey",
3949
"apiKey": {
4050
"parameters": [
@@ -49,7 +59,7 @@
4959
}
5060
},
5161
"tasksApi": {
52-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/crudapiplugin.schema.json",
62+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.1.0/crudapiplugin.schema.json",
5363
"apiFile": "tasks-api.json"
5464
}
5565
}

samples/full-stack-no-backend/.devproxy/tasks-api.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/crudapiplugin.apifile.schema.json",
3-
"baseUrl": "https://api.tasks.local/tasks",
2+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.1.0/crudapiplugin.apifile.schema.json",
3+
"baseUrl": "https://api.contoso.com/tasks",
44
"dataFile": "tasks-data.json",
5+
"enableCors": true,
56
"actions": [
67
{
78
"action": "getAll"

samples/full-stack-no-backend/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The sample includes:
1414

1515
## Compatibility
1616

17-
![Dev Proxy v2.0.0](https://aka.ms/devproxy/badge/v2.0.0)
17+
![Dev Proxy v2.1.0](https://aka.ms/devproxy/badge/v2.1.0)
1818

1919
## Contributors
2020

@@ -24,7 +24,7 @@ The sample includes:
2424

2525
Version|Date|Comments
2626
-------|----|--------
27-
1.0|January 10, 2026|Initial release
27+
1.0.0|January 19, 2026|Initial release
2828

2929
## Prerequisites
3030

samples/full-stack-no-backend/assets/sample.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Demonstrates building a complete task manager application with zero backend using Dev Proxy. Features a vanilla JavaScript frontend with full CRUD operations, API key authentication, realistic latency simulation, and Chrome DevTools integration."
1111
],
1212
"creationDateTime": "2026-01-10",
13-
"updateDateTime": "2026-01-10",
13+
"updateDateTime": "2026-01-19",
1414
"products": [
1515
"Dev Proxy"
1616
],
@@ -25,15 +25,15 @@
2525
},
2626
{
2727
"key": "MOCKS",
28-
"value": "Yes"
28+
"value": "No"
2929
},
3030
{
3131
"key": "PLUGIN",
3232
"value": "No"
3333
},
3434
{
3535
"key": "PROXY VERSION",
36-
"value": "v2.0.0"
36+
"value": "v2.1.0"
3737
}
3838
],
3939
"thumbnails": [
3.37 MB
Loading

samples/full-stack-no-backend/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ <h3>Tasks <span class="latency-indicator" id="latencyIndicator"></span></h3>
398398
</div>
399399

400400
<script>
401-
const API_BASE = 'https://api.tasks.local/tasks';
401+
const API_BASE = 'https://api.contoso.com/tasks';
402402
let apiKey = 'dev-proxy-demo-key';
403403
let isConnected = false;
404404
let nextId = 6;

0 commit comments

Comments
 (0)