Skip to content

Instantly share code, notes, and snippets.

View vquanguit1102's full-sized avatar

vquanguit1102

View GitHub Profile
@vquanguit1102
vquanguit1102 / WSL2_VPN_Workaround_Instructions.md
Created July 25, 2023 08:24 — forked from machuu/WSL2_VPN_Workaround_Instructions.md
Workaround for WSL2 network broken on VPN

Overview

Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active. The workaround breaks down into two problems:

  1. Network connection to internet
  2. DNS in WSL2

This problem is tracked in multiple microsoft/WSL issues including, but not limited to:

@vquanguit1102
vquanguit1102 / sw.js
Created July 5, 2023 03:36 — forked from logaretm/sw.js
Caching GraphQL responses with Service Workers
const QUERY_CACHE_KEY = 'CACHE_V_0';
const GRAPHQL_URL = 'https://example.com/graphql';
self.addEventListener('fetch', e => {
if (isGraphql(e.request)) {
handleGraphQL(e);
}
});