Skip to content

Instantly share code, notes, and snippets.

View chenxuan520's full-sized avatar
🎯
Focusing

chenxuan chenxuan520

🎯
Focusing
View GitHub Profile
/**
* Cloudflare Worker - Tianditu (MapWorld) V2 Proxy
* 基于用户提供的 cURL 复刻,使用官方 Web 端 Key
* 坐标系:CGCS2000 (直接作为 WGS84 使用,无需转换,精度完美)
*/
// Nginx 伪装
const NGINX_HTML = `<!DOCTYPE html><html><head><title>Welcome to nginx!</title><style>body{width:35em;margin:0 auto;font-family:Tahoma,Verdana,Arial,sans-serif;}</style></head><body><h1>Welcome to nginx!</h1><p>If you see this page, the nginx web server is successfully installed and working.</p><p><em>Thank you for using nginx.</em></p></body></html>`;
// 你的 cURL 中使用的关键 Token
/**
* Cloudflare Worker - Baidu Map Adapter (Ellipsoidal Mercator Fix)
*
* 核心修复:
* 使用 [椭球体] 墨卡托逆投影算法,替代 [球体] 算法。
* 修复了因地球扁率导致的南北方向约 20km 的固定偏差。
*/
// ==========================================
// 1. 高精度数学库
/**
* 配置区域
*/
const UPSTREAM_HOST = 'nominatim.openstreetmap.org'; // 目标域名
const UPSTREAM_PROTOCOL = 'https:'; // 目标协议
// 伪装的 Nginx 首页 HTML 代码
const NGINX_HTML = `<!DOCTYPE html>
<html>
<head>
// 利用CloudFlare搭建一个专属的Docker镜像加速和代理工具
// this origin file from https://github.com/cmliu/CF-Workers-docker.io
// 教程为 https://wp.gxnas.com/14739.html
// Docker镜像仓库主机地址
let hub_host = 'registry-1.docker.io';
// Docker认证服务器地址
const auth_url = 'https://auth.docker.io';
// 自定义的工作服务器地址
let workers_url = 'https://docker.011203.xyz/';
'use strict'
/**
* this file from https://github.com/hunshcn/gh-proxy
*/
// index.html interface
async function indexInterface() {
const text = `<!DOCTYPE html>
<html lang="zh-CN">
<head>
@chenxuan520
chenxuan520 / pastebin-worker.js
Last active July 27, 2025 17:19
cloudflare-pastebin
// HTML模板,定义了页面的结构和样式
const HTML_TEMPLATE = `
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: Arial, sans-serif;
display: flex;