Categorygithub.com/devcyclehq/sdk-proxy
modulepackage
2.4.0+incompatible
Repository: https://github.com/devcyclehq/sdk-proxy.git
Documentation: pkg.go.dev

# README

DevCycle Local Bucketing Proxy

This is an implementation that uses our Go Server SDK to initialize and start multiple servers that emulate the response format of the Bucketing API server. This allows SDK's where implementing the WebAssembly bucketing library as a core isn't possible to benefit from the Local Bucketing benefits of the DevCycle platform.

Usage

The application is delivered in multiple formats - a Docker image, a deb, and RPM package, and in a raw application format for local building and implementation.

The proxy handles two modes of operation - you can expose the HTTP server over a TCP port, or over Unix domain sockets. The latter is recommended for servers that will deploy this with the proxy running on the same machine as the SDK, preventing the need for network calls.

The HTTP server mode is a 1:1 replacement for the Bucketing API used by all SDKs in cloud bucketing mode, or can be used directly without an SDK as an API.

Logging can be configured to write to a file for both application logs, and HTTP access logs; or just writing application logs to stdout. By default, the application logs are written to stdout, and the HTTP logs are written to /dev/null.

Docker

The docker image published here is the base runtime version - expecting to be used as a base image for you to extend. The docker image expects that you use the environment variables to configure the proxy, but can be modified and extended to use a configuration file instead.

We also provide the raw application binary to wrap in your own daemon manager, or tie into your existing application lifecycle.

Options

Either a path to a config file which allows specifying multiple instances of a proxy, or environment variables can be used to configure the proxy.

A simple healthcheck for each proxy instance can be performed by sending a GET request to the /healthz endpoint.

We recommend setting the file permissions for the unix socket to be as restrictive as possible. However, as a workaround for deployment issues, you can set the permissions to your own custom mask via the DEVCYCLE_PROXY_UNIX_SOCKET_PERMISSIONS environment variable, or the unixSocketPermissions option in the config file. The default is 0755

Command Line Arguments

ARGUMENTTYPEDEFAULTREQUIREDDESCRIPTION
-hPrints help information, and version info.
-cStringThe path to the config file.

Environment Variables

KEYTYPEDEFAULTREQUIREDDESCRIPTION
DEVCYCLE_PROXY_CONFIGStringThe path to a JSON configuration file.
DEVCYCLE_PROXY_UNIX_SOCKET_PATHStringThe path to the Unix socket.
DEVCYCLE_PROXY_HTTP_PORTInteger8080The port to listen on for HTTP requests. Defaults to 8080.
DEVCYCLE_PROXY_UNIX_SOCKET_ENABLEDTrue or FalsefalseWhether to enable the Unix socket. Defaults to false.
DEVCYCLE_PROXY_UNIX_SOCKET_PERMISSIONSString0755The permissions to set on the Unix socket. Defaults to 0755
DEVCYCLE_PROXY_HTTP_ENABLEDTrue or FalsetrueWhether to enable the HTTP server. Defaults to true.
DEVCYCLE_PROXY_SDK_KEYStringtrueThe Server SDK key to use for this instance.
DEVCYCLE_PROXY_PLATFORMDATA_SDKTYPEString
DEVCYCLE_PROXY_PLATFORMDATA_SDKVERSIONString
DEVCYCLE_PROXY_PLATFORMDATA_PLATFORMVERSIONString
DEVCYCLE_PROXY_PLATFORMDATA_DEVICEMODELString
DEVCYCLE_PROXY_PLATFORMDATA_PLATFORMString
DEVCYCLE_PROXY_PLATFORMDATA_HOSTNAMEString
DEVCYCLE_PROXY_SDKCONFIG_EVENT_FLUSH_INTERVAL_MSDurationThe interval at which events are flushed to the events api in milliseconds.
DEVCYCLE_PROXY_SDKCONFIG_CONFIG_POLLING_INTERVAL_MSDurationThe interval at which the SDK polls the config CDN for updates in milliseconds.
DEVCYCLE_PROXY_SDKCONFIG_REQUEST_TIMEOUTDurationThe timeout for requests to the config CDN and events API in milliseconds.
DEVCYCLE_PROXY_SDKCONFIG_DISABLE_AUTOMATIC_EVENT_LOGGINGTrue or FalsefalseWhether to disable automatic event logging. Defaults to false.
DEVCYCLE_PROXY_SDKCONFIG_DISABLE_CUSTOM_EVENT_LOGGINGTrue or FalsefalseWhether to disable custom event logging. Defaults to false.
DEVCYCLE_PROXY_SDKCONFIG_MAX_EVENT_QUEUE_SIZEIntegerThe maximum number of events to be in the queue before dropping events.
DEVCYCLE_PROXY_SDKCONFIG_FLUSH_EVENT_QUEUE_SIZEIntegerThe minimum number of events to be in the queue before flushing events.
DEVCYCLE_PROXY_SDKCONFIG_CONFIG_CDN_URIStringThe URI of the Config CDN - leave unspecified if not needing an outbound proxy.
DEVCYCLE_PROXY_SDKCONFIG_EVENTSAPIURIStringThe URI of the Events API - leave unspecified if not needing an outbound proxy.

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Parse the config from either a JSON file or environment variables.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author

# Structs

For parsing the full config along with the proxy settings.
For parsing just the config filename, before we know the intended config mechanism.
No description provided by the author
No description provided by the author
No description provided by the author