Setup Go Proxy with DevGuard Dependency Proxy
Setup
- Registry URL:
http://localhost:8080/api/v1/dependency-proxy/go - Configuration: Set via
GOPROXYenvironment variable
Using enviromental variables
Set the GOPROXY environment variable:
export GOPROXY="http://localhost:8080/api/v1/dependency-proxy/go"
go get github.com/example/packageTesting
DevGuard includes test packages for verifying the proxy functionality:
github.com/fake-org/malicious-package
These test packages are safe to use and will always be blocked by the proxy.
API Reference
Proxy Endpoints
GET /api/v1/dependency-proxy/go/*- Go modules proxy
Response Headers
X-Cache: HIT|MISS- Indicates if the response was served from cacheX-Proxy-Type: go- Identifies the proxy typeX-Malicious-Package: blocked- Present when a package is blocked
Status Codes
200 OK- Package successfully proxied403 Forbidden- Malicious package blocked503 Service Unavailable- Database not yet loaded502 Bad Gateway- Upstream registry error