containerurl

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package containerurl provides helpers for rewriting localhost URLs to host.containers.internal so they are reachable from inside a container.

Index

Constants

View Source
const ContainerHost = "host.containers.internal"

ContainerHost is the hostname used to reach the host machine from inside a container.

Variables

This section is empty.

Functions

func RewriteMCPCommandArgs

func RewriteMCPCommandArgs(mcp *workspace.McpConfiguration)

RewriteMCPCommandArgs rewrites localhost URLs in MCP command args so they are reachable from inside a container. Only command-based MCP servers are affected — these are spawned inside the container and may reference localhost to reach host services. URL-based MCP servers (remote endpoints) are not modified.

func RewriteURL

func RewriteURL(rawURL string) string

RewriteURL replaces localhost aliases in a URL with host.containers.internal so the URL is reachable from inside a container. If the input is not a valid URL or does not reference localhost, it is returned unchanged.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL