This project demonstrates how to use Envoy Proxy with a Node.js web server inside a Docker container.
The Node.js Envoy Proxy project showcases the integration of Envoy Proxy with a Node.js web server running in a Docker container. Envoy Proxy is used as a sidecar proxy to handle incoming traffic and forward requests to the Node.js server. This setup provides features like load balancing, routing, and service discovery.
- Integration of Envoy Proxy with Node.js web server
- Dockerized deployment for easy setup and scalability
- Load balancing and routing capabilities provided by Envoy Proxy
To run the Node.js Envoy Proxy project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/akarsh/nodejs-envoy-proxy.git cd nodejs-envoy-proxy
-
Install dependencies:
npm install
-
Build the Docker images:
docker-compose build
After installation, you can run the project using Docker Compose:
docker-compose up
Once the containers are up and running, you can access the Node.js web server via http://localhost:3000 and the Envoy Proxy at http://localhost:8080.
To replace <IP_ADDRESS> with the IP address of your host machine, you need to determine the IP address that your Envoy Proxy container should use to reach the Node.js server running on the host.
Here's how you can find the IP address of your host machine:
- macOS
If you're using macOS, you can use the ifconfig command to find the IP address of your network interface. Open a terminal and run:
ifconfig | grep "inet "
Look for the IP address associated with your network interface (usually en0 or en1).
- Linux
If you're using Linux, you can use the ip addr show command to find the IP address of your network interface. Open a terminal and run:
ip addr show
Look for the IP address associated with your network interface (usually eth0 or wlan0).
- Windows
If you're using Windows, you can use the ipconfig command to find the IP address of your network interface. Open a command prompt and run:
ipconfig
Look for the IPv4 address associated with your network interface.
Once you have the IP address, replace <IP_ADDRESS> in your Envoy configuration file with the IP address you found. Ensure that your Node.js server is listening on the same IP address. After making the changes, restart your Envoy Proxy server, and it should now be able to communicate with your Node.js server using the correct IP address.
This project is licensed under the GPL-3.0 License. See the LICENSE file for details.