Skip to content

HTTPS support for dev server #1766

@asvishnyakov

Description

@asvishnyakov

Describe the bug
Now there are hardcoded values in both backend and frontend which break https and custom host support when developing application with chainlit.

To Reproduce
Steps to reproduce the behavior:

  1. Enable HTTPs and/or custom host using environment variables
  2. Try different screnarios

As far as I know:

  • Hardcoded http in server, so you receive

Your app is available at http://localhost:8000

if host == DEFAULT_HOST:
url = f"http://localhost:{port}{ROOT_PATH}"
else:
url = f"http://{host}:{port}{ROOT_PATH}"

by default even when https enabled. You also will receive "Empty response" error in opened browser page

  • Hard coded http://localhost:8000 for dev server in frontend, so you can't debug frontend if https or custom host enabled
    const devServer = 'http://localhost:8000' + getRouterBasename();
  • No e2e tests for these screnarios (https and custom host)

Expected behavior
Both cases should be seamlessly supported

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions