Repository navigation
Allow HTTP base URLs for private LAN hosts (fixes #45) - #47
Open
VikasRajput-18 wants to merge 1 commit into
Open
VikasRajput-18 wants to merge 1 commit into
VikasRajput-18 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #45.
validateBaseURL()only allowed plain HTTP forlocalhost,127.0.0.1and[::1], so local model servers on another machine in the same network (e.g. LM Studio athttp://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:localhost,127.0.0.0/8,::110.0.0.0/8,172.16.0.0/12,192.168.0.0/16169.254.0.0/16,fe80::/10fc00::/7Public 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
tests/backend.test.mjsfor accepted LAN addresses and rejected public/look-alike addresses.npm testpasses (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:1235is rejected with "Remote endpoints require HTTPS".After (this branch): the same URL saves, and a chat message gets a reply from the LM Studio model.

Still rejected:

http://8.8.8.8:1234returns "Remote endpoints require HTTPS".