Ideas for Arc XP

Ability to serve engine locally on https

As an engine developer, I would like to be able to access locally running engine through https.


3rd party integrations like social logins require apps to be on https for callbacks.

  • Fatih Yildiz
  • Aug 3 2021
  • Future consideration
  • Attach files
  • JP Blanchette commented
    24 Mar 13:49

    Developers can achieve localhost HTTPS by using Caddy: https://caddyserver.com/


    Caddyfile

    # PB Fusion site proxy
    arc-local.theglobeandmail.com {
    # Transport Layer Security for HTTPS
    tls ./dev/certs/arc-local.theglobeandmail.com.pem ./dev/certs/arc-local.theglobeandmail.com-key.pem
    # Reverse Proxy from HTTP on port 8080 to HTTPS on port 80
    reverse_proxy 127.0.0.1:8080 {
    header_up Host "localhost"
    header_up X-Real-IP {remote}
    header_up X-Forwarded-Host "localhost"
    header_up X-Forwarded-Server "localhost"
    header_up X-Forwarded-Port {port}
    }
    }


    /privates/etc/hosts

    127.0.0.1 arc-local.theglobeandmail.com


    .env

    # Not an ArcXP system env variable but works here vs. not when in localhost.js. This port is used by Caddy.
    PORT=8080


    package.json

    scripts: {
    "secure": "caddy run"
    "start": "run-p secure fusion:start",
    }


    Terminal

    npm run start