---
title: "Discussion on \"Local HTTPS and CORS: Pointing a Browser Frontend at a Mockoon Server\" | Hashnode"
description: "Discussion on \"Local HTTPS and CORS: Pointing a Browser Frontend at a Mockoon Server\". How to secure a local Mockoon server with trusted HTTPS and the right CORS headers."
url: "https://hashnode.com/posts/mockoon-https-tls-cors-browser-frontend/6aed934a0aa60f426d979355"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Local HTTPS and CORS: Pointing a Browser Frontend at a Mockoon Server](https://blogs.powerduck.com/mockoon-https-tls-cors-browser-frontend?utm_source=hashnode&utm_medium=feed)

How to secure a local Mockoon server with trusted HTTPS and the right CORS headers.

Nov 6 · 5 min read · blogs.powerduck.com  
Read the article

-   [#mocking](https://hashnode.com/tag/mocking)
-   [#api](https://hashnode.com/tag/api)
-   [#developers](https://hashnode.com/tag/developers)

## Written by

[Powerduck](https://hashnode.com/@powerduck)

@powerduck · hon

  
[View profile](https://hashnode.com/@powerduck)

## Responses 1

Markdown supported · ⌘↵ to post

[RequestFox](https://hashnode.com/@requestfox)

[Nov 6](https://hashnode.com/posts/mockoon-https-tls-cors-browser-frontend/6aed934a0aa60f426d979355/comment/6aed9cef05f78312fe1fbd78)

Splitting TLS and CORS into two separate checks is the most useful part of this. Two small additions for this setup: if the mock echoes the request's Origin back instead of a fixed value, also send "Vary: Origin", so a cache in between can't hand one origin's answer to another. And Access-Control-Max-Age helps while you work, but the browser keeps using the cached preflight until it expires (Chromium caps it at 2 hours, Firefox at 24), so a CORS rule you just changed can look like it didn't apply. Keep the max age short while you're still changing rules.
