Gatling with ToxiProxy

Gatling version: 3.11.5
Gatling flavor: java
Gatling build tool: maven

Hello Gatling Community,

I am new to Gatling and I am trying to use it together with ToxiProxy. My scenario is to send requests in Computers database with or without proxies.

Could someone help me with the setup?

  • ToxiProxy is up and running:

             CONTAINER ID.......2b8e486ea0b3
             IMAGE..............shopify/toxiproxy
             COMMAND............"/go/bin/toxiproxy -…" 
             CREATED............4 weeks ago
             STATUS.............Up 3 hours
             PORTS..............0.0.0.0:8474->8474/tcp, :::8474->8474/tcp
             NAMES..............toxiproxy
    
  • I have created a toxic through toxiproxy-cli (no proxies at the moment):
    toxiproxy-cli create gatling_test --listen localhost:26379 --upstream computer-database.gatling.io:80

             Name...............gatling_test
             Listen.............127.0.0.1:26379
             Upstream...........computer-database.gatling.io:80
             Enabled............enabled
             Toxics.............None
    
  • In the Java script I am not sure what is missing to make the connection work:
    gatling-toxiproxy

As described in the documentation, the proxy HTTP configuration supports HTTP, HTTPS, SOCKS4 and SOCKS5 proxies.

ToxiProxy is none of these, it’s a “TCP proxy” (more of a gateway, actually).

That’s not something we can help with here. I recommend you check the ToxiProxy documentation, find a way to use it with curl, then translate your curl command into Gatling usage.

Thank you very much for your answer!! I actually realized I just need to use as the baseUrl() the listening address of ToxiProxy. It worked like a charm! :slight_smile:
Gatling+ToxiProxy

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.