containerurl

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 RewriteMCPCommandArgsWithHost added in v0.17.0

func RewriteMCPCommandArgsWithHost(mcp *workspace.McpConfiguration, containerHost string)

RewriteMCPCommandArgsWithHost rewrites localhost URLs in MCP command args using the given containerHost so they are reachable from inside a container or sandbox. Only command-based MCP servers are affected.

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.

func RewriteURLWithHost added in v0.17.0

func RewriteURLWithHost(rawURL, containerHost string) string

RewriteURLWithHost replaces localhost aliases in a URL with the given containerHost so the URL is reachable from inside a container or sandbox. 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