Help us shape the future of Go! Take the 2026 Go Developer Survey

clouddial

package
v0.98.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package clouddial blocks Cloud job HTTP from local address ranges.

Index

Constants

This section is empty.

Variables

View Source
var ErrLocalAddress = errors.New("cloud job refused a local address")

ErrLocalAddress is returned when a Cloud job dials a local address range.

Functions

func Client

func Client() *http.Client

Client is the HTTP client for a Cloud job. It refuses every reserved address block, and it returns a redirect response without dialing the next address.

10.1.2.3 is refused. 1.1.1.1 is allowed. A 302 from 1.1.1.1 is the result the flow sees. The Location target is not dialed.

func Job

func Job() bool

Job reports whether this process is a Cloud job. The Cloud worker sets CLOUD_JOB_ID before it runs the flow. No extra setting is required.

func Local

func Local(ip netip.Addr) bool

Local reports whether ip is in a reserved address block.

10.1.2.3 and 203.0.113.5 are reserved. 1.1.1.1 is not. ::ffff:10.1.2.3 is reserved. ::ffff:1.1.1.1 is not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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