Skip to content

Allow HTTP base URLs for private LAN hosts (fixes #45) - #47

Open
VikasRajput-18 wants to merge 1 commit into
techjarves:mainfrom
VikasRajput-18:allow-lan-http-endpoints
Open

VikasRajput-18 wants to merge 1 commit into
techjarves:mainfrom
VikasRajput-18:allow-lan-http-endpoints

Conversation

@VikasRajput-18

Copy link
Copy Markdown

Fixes #45.

validateBaseURL() only allowed plain HTTP for localhost, 127.0.0.1 and [::1], so local model servers on another machine in the same network (e.g. LM Studio at http://192.168.137.37:1234) were rejected with "Remote endpoints require HTTPS".

This PR replaces the hardcoded list with an isPrivateHost() check that also allows HTTP for addresses that cannot be reached from the public internet:

  • Loopback: localhost, 127.0.0.0/8, ::1
  • RFC 1918 private IPv4: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
  • Link-local: 169.254.0.0/16, fe80::/10
  • IPv6 unique local: fc00::/7

Public IPs and domain names still require HTTPS, including look-alike domains such as 10.0.0.5.nip.io, so the existing protection against sending credentials over plaintext to remote hosts is unchanged. This matches the dashboard hint "Local HTTP or remote HTTPS".

Tests

  • Added cases in tests/backend.test.mjs for accepted LAN addresses and rejected public/look-alike addresses. npm test passes (50/50).

Manual testing (macOS, LM Studio)

Connected the dashboard to LM Studio through a private LAN IP over HTTP.

Before (main): http://192.168.1.2:1235 is rejected with "Remote endpoints require HTTPS".
preview

After (this branch): the same URL saves, and a chat message gets a reply from the LM Studio model.
preview (1)

Still rejected: http://8.8.8.8:1234 returns "Remote endpoints require HTTPS".
preview (2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow connecting to LAN-hosted LM Studio endpoints over HTTP

1 participant