Skip to content

工具库

css

动画库

  1. ScrollTrigger
  2. scrollmagic

threejs 地球模型

three-globe

手势识别

hammerjs

资源预加载

pxloader

本地localhost使用https协议

anchor.dev

结合文档可运行代码:

js
// index.js
const ACME_CONTACT="******"
const ACME_DIRECTORY_URL="******"
const ACME_HMAC_KEY="***"
const ACME_KID="******"
const HTTPS_PORT="8089"
const SERVER_NAMES="local.lcl.host,local.internal,local.lan,local.local,local.localhost,local.test"

const { createSNICallback } = require('anchor-pki/auto-cert/sni-callback');
const { TermsOfServiceAcceptor } = require('anchor-pki/auto-cert/terms-of-service-acceptor');
const https = require('node:https');

const app = (req, res) => {
  // setup your app
  console.log('req' ,req);
  res.end('Hello World');
  
}

const SNICallback = createSNICallback({
  name: 'sni-callback',
  tosAcceptors: TermsOfServiceAcceptor.createAny(),
  cacheDir: 'tmp/acme',

  // The following are defaults
  //
  allowIdentifiers: SERVER_NAMES,
  directoryUrl: ACME_DIRECTORY_URL,
  contact: ACME_CONTACT,
  externalAccountBinding: {
    kid: ACME_KID,
    hmacKey: ACME_HMAC_KEY
  },

});

https.createServer({SNICallback}, app).
  listen(HTTPS_PORT);