Skip to content

Instantly share code, notes, and snippets.

View n-ts's full-sized avatar

Nikoloz n-ts

  • Georgia / Estonia / Kuwait
View GitHub Profile
@n-ts
n-ts / worker.js
Created October 3, 2018 20:21
Cloudflare Workers - Load balancing to nearest datacenter from current POP
/*
--------------------------------------------------------
Please note that this grouping is just for example...
You can rearrange POPs, remove or add dacaneters according to your needs.
--------------------------------------------------------
First, we have to get all Cloudflare POP codes (three letter airport codes) from https://www.cloudflarestatus.com/
North America is routed to Chigaco datacenter;
Europe, Africa and Middle East is routed to Amsterdam datacenter;