A desktop application built with Electron for managing and running API Gateway proxy servers locally. Create multiple workspaces, configure endpoints, map variables, and control proxy servers with an intuitive interface.
- 🚀 Multiple Workspaces: Create and manage multiple proxy server workspaces simultaneously
- 🔧 Gateway Configuration: Import and edit AWS API Gateway-style configurations
- 🌐 Endpoint Management: Enable/disable individual endpoints and configure HTTP methods
- 📝 Variable Mapping: Map stage variables and path parameters dynamically
- 🎯 Path Parameter Support: Handle dynamic path parameters (e.g.,
/users/{id}) - 📊 Server Status: Real-time server status monitoring and logs
- 💾 Persistent Storage: Workspaces are automatically saved to localStorage
- 🎨 Modern UI: Built with React, TypeScript, and Tailwind CSS
- Node.js (v18 or higher)
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd local-gateway-proxy- Install dependencies:
npm install- Build the application:
npm run build- Start the application:
npm startThe application can be built into installable packages for macOS, Windows, and Linux.
First, generate the application icons:
npm run build:iconsmacOS:
npm run build:macCreates DMG and ZIP files for both Intel (x64) and Apple Silicon (arm64).
Windows:
npm run build:winCreates NSIS installer and portable executable.
Linux:
npm run build:linuxCreates AppImage, DEB, and RPM packages.
All Platforms:
npm run build:allAll built files will be placed in the release/ directory.
For more detailed build instructions, see BUILD.md.
Run the application in development mode with hot-reload:
npm run devThis will:
- Start the Vite dev server on port 5173
- Compile TypeScript files
- Launch Electron with hot-reload enabled
Get up and running in 5 minutes:
- Start the app:
npm start - Create a workspace: Click "+" in the sidebar (or use the default one)
- Paste your config: Go to Config tab and paste your AWS API Gateway JSON
- Set variables: Go to Variables tab and fill in the values
- Start server: Toggle the server switch ON
- Test it: Make a request to
http://localhost:3000/your-endpoint
That's it! Your proxy server is now running.
This guide will walk you through using Local Gateway Proxy from start to finish.
After installation, start the application:
npm startThe application window will open, showing the sidebar on the left and the main workspace area on the right.
- Click the "+" button in the sidebar (or the workspace will be created automatically on first launch)
- A new workspace appears with a default name like "Workspace 1"
- Rename the workspace by clicking on its name in the sidebar and typing a new name (e.g., "Production API" or "Development")
- Each workspace automatically gets a unique port number (starting from 3000)
- Select your workspace from the sidebar
- You'll see the main workspace view with tabs: Config, Endpoints, Variables, and Logs
- Click on the "Config" tab (usually selected by default)
- Paste your AWS API Gateway configuration JSON into the editor
Here's a sample configuration you can use:
{
"paths": {
"/users/{id}": {
"get": {
"x-amazon-apigateway-integration": {
"type": "http_proxy",
"uri": "https://jsonplaceholder.typicode.com/users/${stageVariables.userId}/{id}"
}
}
},
"/posts": {
"get": {
"x-amazon-apigateway-integration": {
"type": "http_proxy",
"uri": "https://jsonplaceholder.typicode.com/posts"
}
},
"post": {
"x-amazon-apigateway-integration": {
"type": "http_proxy",
"uri": "https://jsonplaceholder.typicode.com/posts"
}
}
},
"/comments": {
"get": {
"x-amazon-apigateway-integration": {
"type": "http_proxy",
"uri": "https://jsonplaceholder.typicode.com/comments?postId=${stageVariables.postId}"
}
}
}
}
}- The app automatically parses the configuration when you paste it
- You'll see endpoints appear in the "Endpoints" tab automatically
- Click on the "Variables" tab
- You'll see all stage variables extracted from your configuration (e.g.,
stageVariables.userId,stageVariables.postId) - Enter values for each variable:
- For
stageVariables.userId: Enter a number like1 - For
stageVariables.postId: Enter a number like1
- For
- Variables are used to replace
${stageVariables.variableName}placeholders in your URI templates
Note: Path parameters (like {id}) are automatically extracted from the request URL and don't need to be set manually.
- Click on the "Endpoints" tab
- You'll see a list of all parsed endpoints with:
- HTTP method (GET, POST, etc.)
- Path pattern
- Target URI template
- Enable/disable toggle
- Review each endpoint to ensure they're correct
- Toggle endpoints on/off as needed:
- Enabled endpoints (toggle ON) will be proxied when the server is running
- Disabled endpoints (toggle OFF) will return 404 even if the server is running
- Locate the server status toggle at the top of the workspace view
- Click the toggle to start the server
- You'll see:
- The toggle switch to "ON" (green/active state)
- A success message in the logs: "Server started on port [port number]"
- Information about how many endpoints were loaded
- Check the "Logs" tab to see server activity and request logs
Once the server is running, you can test it using curl, Postman, or your browser:
GET request with path parameter:
curl http://localhost:3000/users/1This will proxy to: https://jsonplaceholder.typicode.com/users/[userId]/1
GET request with query parameters:
curl http://localhost:3000/commentsThis will proxy to: https://jsonplaceholder.typicode.com/comments?postId=[postId]
POST request:
curl -X POST http://localhost:3000/posts \
-H "Content-Type: application/json" \
-d '{"title": "Test", "body": "Content"}'- Request comes to:
http://localhost:3000/users/123 - App matches the endpoint:
/users/{id}with GET method - Extracts path parameter:
id = 123 - Resolves variables: Replaces
${stageVariables.userId}with the value you set - Proxies to:
https://jsonplaceholder.typicode.com/users/[userId]/123 - Returns the response to your client
- Click on the "Logs" tab to see:
- Server start/stop events
- Request logs showing which endpoints were hit
- Error messages if something goes wrong
- Logs show timestamps and message types (info, success, error)
- Click the server status toggle again to stop the server
- The toggle switches to "OFF"
- A log entry confirms: "Server stopped"
- All requests to the proxy port will fail until you start it again
- Click the "+" button in the sidebar again
- Create a second workspace (e.g., "Staging API")
- Configure it with different settings:
- Different port (e.g., 3001)
- Different configuration
- Different variable values
- Switch between workspaces by clicking on them in the sidebar
- Run multiple servers simultaneously - each workspace can have its own server running independently
- Select a workspace
- Find the port field in the workspace settings
- Change the port number (e.g., from 3000 to 8080)
- Restart the server for the change to take effect
- Make changes to your configuration JSON
- The endpoints will be re-parsed automatically
- Restart the server to apply the changes:
- Stop the server
- Start it again
- New endpoints will be registered
- Go to the "Endpoints" tab
- Toggle OFF any endpoint you want to disable
- Restart the server for changes to take effect
- Disabled endpoints will return 404 when accessed
The app expects an AWS API Gateway-style configuration with this structure:
{
"paths": {
"/your-path/{param}": {
"http-method": {
"x-amazon-apigateway-integration": {
"type": "http_proxy",
"uri": "https://target-url.com/path/${stageVariables.varName}/{param}"
}
}
}
}
}Key Points:
paths: Object containing all your API paths- Path parameters: Use
{paramName}in the path (e.g.,/users/{id}) - HTTP methods: Use lowercase (get, post, put, delete, patch, etc.)
uri: The target URL where requests will be proxied- Stage variables: Use
${stageVariables.variableName}format - Path parameters: Use
{paramName}format (will be replaced from the request URL)
Here's a complete example workflow:
Scenario: You want to proxy requests to a JSONPlaceholder API with custom variables.
-
Start the app and create a workspace named "JSONPlaceholder Proxy"
-
Paste this configuration in the Config tab:
{
"paths": {
"/users/{userId}": {
"get": {
"x-amazon-apigateway-integration": {
"type": "http_proxy",
"uri": "https://jsonplaceholder.typicode.com/users/${stageVariables.apiVersion}/{userId}"
}
}
}
}
}-
Go to Variables tab and set:
stageVariables.apiVersion:v1
-
Go to Endpoints tab and verify the endpoint
/users/{userId}is enabled -
Start the server by toggling the switch ON
-
Test with curl:
curl http://localhost:3000/users/1-
What happens:
- Request:
GET http://localhost:3000/users/1 - App extracts:
userId = 1from the path - App replaces:
${stageVariables.apiVersion}withv1 - Proxies to:
https://jsonplaceholder.typicode.com/users/v1/1 - Returns the response
- Request:
-
Check logs to see the request was processed successfully
- Use descriptive workspace names to organize different environments
- Set default variable values that work for most cases
- Enable only needed endpoints to reduce complexity
- Check logs regularly to monitor proxy behavior
- Test endpoints before relying on them in production workflows
- Keep configurations versioned - copy/paste works well for backup
proxy-app/
├── src/
│ ├── main/ # Electron main process
│ │ ├── index.ts # Main window and IPC handlers
│ │ └── server.ts # Express proxy server manager
│ ├── preload/ # Preload scripts
│ │ └── index.ts # Context bridge setup
│ └── renderer/ # React frontend
│ └── src/
│ ├── App.tsx # Main app component
│ ├── components/ # UI components
│ ├── utils/ # Utilities and parsers
│ └── types.ts # TypeScript definitions
├── dist/ # Build output
├── package.json
└── vite.config.ts # Vite configuration
- Electron - Desktop application framework
- React - UI library
- TypeScript - Type-safe JavaScript
- Vite - Build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- Express - HTTP server framework
- http-proxy - HTTP proxy middleware
- Radix UI - Accessible UI components
- Configuration Parsing: The app parses AWS API Gateway JSON configurations to extract endpoints and variables
- Server Management: Each workspace runs an independent Express server on a configurable port
- Request Proxying: Incoming requests are matched against configured endpoints and proxied to target URLs
- Variable Resolution: Stage variables and path parameters are resolved before proxying requests
- Endpoint Filtering: Only enabled endpoints are registered in the Express router
- Local API Development: Proxy requests to remote APIs while developing locally
- API Testing: Test different API configurations without deploying
- Environment Simulation: Simulate different API Gateway stages locally
- Request Debugging: Monitor and log all proxied requests
If you get a "port already in use" error:
- Change the port number in the workspace settings
- Stop any other services using that port
- Ensure the server is running (check the status switch)
- Verify the endpoint is enabled
- Check the server logs for errors
- Validate your gateway configuration JSON
- Ensure variables are set in the Variables tab
- Check that variable names match exactly (case-sensitive)
- Verify the variable format:
${stageVariables.variableName}
ISC
Contributions are welcome! Please feel free to submit a Pull Request.