mirror of
https://github.com/usestrix/strix.git
synced 2026-08-23 19:32:37 +02:00
feat: enable container access to host localhost services
Rewrite localhost/127.x.x.x/0.0.0.0 target URLs to use host.docker.internal, allowing the container to reach services running on the host machine. - Add extra_hosts mapping for host.docker.internal on Linux - Add HOST_GATEWAY env var to container - Add rewrite_localhost_targets() to transform localhost URLs - Support full 127.0.0.0/8 loopback range and IPv6 ::1
This commit is contained in:
@@ -30,9 +30,10 @@ from strix.interface.utils import (
|
||||
image_exists,
|
||||
infer_target_type,
|
||||
process_pull_line,
|
||||
rewrite_localhost_targets,
|
||||
validate_llm_response,
|
||||
)
|
||||
from strix.runtime.docker_runtime import STRIX_IMAGE
|
||||
from strix.runtime.docker_runtime import HOST_GATEWAY_HOSTNAME, STRIX_IMAGE
|
||||
from strix.telemetry.tracer import get_global_tracer
|
||||
|
||||
|
||||
@@ -377,6 +378,7 @@ Examples:
|
||||
parser.error(f"Invalid target '{target}'")
|
||||
|
||||
assign_workspace_subdirs(args.targets_info)
|
||||
rewrite_localhost_targets(args.targets_info, HOST_GATEWAY_HOSTNAME)
|
||||
|
||||
return args
|
||||
|
||||
|
||||
Reference in New Issue
Block a user