Skip to main content
Version: Next

Route Your API Traffic

Once the gateway is installed, the next step is to route your API traffic through the Lunar Gateway. There are two main routing methods, Direct Mode and Interceptor Mode, and the right choice depends on your specific needs and setup.

  • Direct Mode: If you need a quick, lightweight setup without installing additional software, Direct Mode is ideal. This method allows you to route API traffic by simply modifying your HTTP requests with specific headers and adjusting the request URL. Choose this if you need minimal configuration and prefer not to install anything in your application environment.
    • Best For: Quick integrations, minimal setup.
  • Interceptor Mode: For more advanced traffic management and additional features like automatic request capture and fail-safes, Interceptor Mode is recommended. This mode involves installing the Lunar Interceptor into your application, which automatically captures and routes HTTP/S traffic through the Lunar Gateway. If your environment requires more control, such as redirection or managing high-traffic flows, this is the better option.
    • Best For: Advanced features, automated request capture, fail-safes.

Making the Right Choice

  • If you need a fast, no-install solution: Use Direct Mode.
  • If your setup requires deeper integration with automated traffic capture and redirection: Choose Interceptor Mode.

Both options provide flexibility and ensure that your API traffic is routed efficiently through the Lunar Gateway, giving you the tools to manage, optimize, and secure your API consumption.

note

Communication between the Lunar Interceptor and the Lunar.dev Gateway is conducted over HTTP by default. However, HTTPS communication is available for users on Lunar Pro for enhanced security.