Skip to main content

[Short Blog] Setting up WSO2 EI/MI with proxy server

 In this blog, we will dive into the process of configuring WSO2 Enterprise Integrator (EI) to work behind a proxy server. We will discuss the necessary configurations and steps needed to ensure that your WSO2 EI can properly connect to the internet and access external resources while being behind a proxy server. Whether you are looking to secure your WSO2 EI or need to comply with organizational policies, this guide will provide the information you need to successfully set up WSO2 EI with a proxy server.

  1. Download https://squidman.net/squidman/index.html to start a proxy server
  2. Install and open SquidMan on the server computer.
  3. Optionally, you can use basic authentication to connect this proxy service. For that, create a user and password with following command(I have given admin as the username and admin as the password):
htpasswd -c /usr/local/etc/squid_passwords admin

4. (Do this if you follow step 3) Add the following configuration into the squidman template

auth_param basic program /usr/local/Cellar/squid/4.13/libexec/basic_ncsa_auth /usr/local/etc/squid_passwords
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated

5. Add the client computer IP address that allow to access this proxy with Clients tab.

6. Click Save and start the Squid server.

7. You can now test the proxy server by using following curl command on the client machine.

If you didn’t used basic authentication then:

curl -v -x http://192.168.43.212:8080 http://www.google.com/

With the basic authentication, curl would be as follows:

curl -v -x http://admin:admin@192.168.43.212:8080 http://www.google.com/

Setting up WSO2 EI/MI

8. Add the following deployment.toml configuration to <MI_HOME>/conf/deployment.toml

[[transport.http.proxy_profile]]
proxy_host = "192.168.43.212"
proxy_port = "8080"
target_hosts = ["*"]
proxy_username = "admin"
proxy_password = "admin"

[[transport.http.secured_proxy_profile]]
target_hosts = ["*"]
proxy_host = "192.168.43.212"
proxy_port = "8080"
proxy_username = "admin"
proxy_password = "admin"

If basic auth not defined, then you can ignore proxy_username and proxy_password.

9. Add following proxy service to to MI:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="test"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">

<target>
<inSequence>
<call>
<endpoint>
<http method="get" uri-template="https://run.mocky.io/v3/7c30406d-3777-4d50-afe2-316f3e0d8a5b"/>
</endpoint>
</call>
<log level="full"/>
<respond/>
</inSequence>
</target>
<description/>
</proxy>

10. Invoke the proxy service and you will get the response through the proxy server. If you add invalid credentials for deployment.toml, this will fail.

In conclusion, setting up WSO2 Enterprise Integrator (EI) to work behind a proxy server can be a bit tricky but with the right configurations and steps, it can be done smoothly. By following the guidelines provided in this blog, you should be able to successfully configure your WSO2 EI to work behind a proxy server. It's important to note that different organizations might have different proxy configurations and policies, so it's essential to check with your organization's IT department for the specific configurations needed. 

Comments

Popular posts from this blog

Gentle Introduction to the Envoy Proxy and Load-balancing

For a devops engineer, load balancing is a popular word. You need to figure out a way to scale the system so that it can manage it correctly when enormous traffic enters your system. One alternative is to boost the running single node’s efficiency. Adding more nodes and distributing the job among these nodes is another option. Having many nodes has another high availability added benefit. Envoy proxy is a proxy service that in the growing trend has been used as a service mesh. In this blog post, we’ll see the load balancing aspect of the Envoy Proxy. Load Balancers Load balancers is an endpoint that listens to the request that comes into the computation cluster. When application enters the Load Balancer, it checks for accessible worker nodes and distributes requests among worker nodes. Load balancer has the following characteristics. Service Discovery: Check available worker nodes Health check: Regularly inspect worker nodes health. Load balancing: Distribute the reque

Database Internel Architecture: SQLite

Introduction A database is an essential part of building a software system which used to store and read data efficiently. Here, We are going to discuss some architectural details of database implementation by using an early version of SQLite. SQLite is a small database application which used in millions of software and devices. SQLite invented by D.Richard Hipp in August 2000. SQLite is a high performance, lightweight relational database. If you are willing to learn internal of a database in coding level, then SQLite is the best open source database available out there with highly readable source code with lots of documentation. Reading later versions of SQLite become a little harder since it contains lots of new features. In order to understand the basic implementation of database internals, You should have good knowledge about data structures, some knowledge about Theory of Computing and how an operating system works. Here we are looking into the SQLite 2.5.0 version. Here

Weird Programming Languages

There are thousands of programming languages are invented and only about hundred of programming languages are commonly used to build software. Among this thousands of programming languages, there are some weird type of programming languages can be also found. These programming languages are seems to be called weird, since their programming syntax and the way it represent its code. In this blog we will look into some of these language syntax. Legit Have you ever wonder, when you come to a Github project that print hello world program, but you cannot see any codes or any content. Check this link  https://github.com/blinry/legit-hello  and you will see nothing in this repository. But trust me, there is hidden code in this project. If you see the  commit  section, you can reveal the magic. Yeah, you are right. Its storing hello world code in inside the git commit history. If you clone this project and run the following command, then you can see the hidden code in this project. g