Invalid Host Header error

Host header checks are a security measure in production environments. However, some frameworks perform them also in dev mode and only accept localhost in the Host header. Since LocalCan sets the Host header to either your local domain or Public URL, you should consult your framework's documentation on how to disable host check in development, or add your domain to the allowed hosts.



In Angular, you can disable host checking by modifying the angular.json file:

  "projects": {
    "your-project-name": {
      "architect": {
        "serve": {
          "options": {
            "disableHostCheck": true,

or run your app with a flag:

ng serve --disable-host-check

Django (Python)

In Django, you can modify the ALLOWED_HOSTS in your file:
ALLOWED_HOSTS = ['myapp.local', 'localhost', '', ...]

For other frameworks, please refer to their documentation.

© 2024 LocalCan™. All rights reserved.