Monday, March 11, 2013

Vaurien: The Chaos Proxy

I had a need to test out a program's behavior when its backend web server returned errors. Unit testing would have been difficult in this case, because I specifically wanted to test the program's macro result when encountering, say, 10% server response errors.

After searching around, I came across Vaurien, the Chaos TCP Proxy. It's seriously cool. As its name suggests, it's a TCP proxy server that you can route a local connection through to a backend server. In TCP mode, it can delay packets, insert bad data, or drop packets, testing the socks (pun intended) off your application.

It also supports the application-level protocols: HTTP, Memcache, MySQL, Redis, and SMTP, and its architecture is very modular, so it's easy to plug in new protocols.

For example, here's how I can run it in HTTP mode:
$ vaurien --protocol http --proxy 127.0.0.1:8888 \
          --backend www.google.com:80 --behavior 50:error
This says to run an HTTP proxy that connects to google.com on the backend and return a 5xx HTTP error code 50% of the time. Testing it out with curl:
$ curl --head -H "Host: www.google.com" http://127.0.0.1:8888/
HTTP/1.1 200 OK
...

$ curl --head -H "Host: www.google.com" http://127.0.0.1:8888/
HTTP/1.1 500 Internal Server Error
Content-Type: text/html; charset=UTF-8

$ curl --head -H "Host: www.google.com" http://127.0.0.1:8888/
HTTP/1.1 502 Bad Gateway
Content-Type: text/html; charset=UTF-8

Filed this away as a super useful tool.

151 comments:

  1. I was reading through some of your blog posts on this internet site and I believe this site is rattling informative! Keep on posting.
    FileCrop UK proxy

    ReplyDelete
  2. Compare 10 Private Proxy Service! Use Private Proxies for internet marketing. Using private Proxies with SEO tools eg, GSA Search Engine Ranker,Scrapebox.scrapebox proxies

    ReplyDelete
  3. I would just like to update you on a few small items. 1. The SERVER file on Windows7 systems is in %USERPROFILE%\AppData\Roaming\Subversion 2. If you were crazy enough to try to fill in and use Eclipses built in proxy settings (they don't work for those use NTLMv2 proxy خرید فیلترشکن 2016

    ReplyDelete
  4. I look the site it was a very good and very informative in many aspects thanks for share such a nice work. access TorrentCrazy in UK

    ReplyDelete
  5. I'm really impressed with your writing skills and also with the format on your weblog. Holborn Assets

    ReplyDelete
  6. Keep in mind that not all proxies are evils so only use this technique if you are sure you know anyone bad is visiting your site with proxy. Whatsapp DP

    ReplyDelete
  7. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post.Visit our website atcara cepat kurus tanpa olahraga

    ReplyDelete
  8. I am attempting to find things to enhance my site!I suppose its ok to use a few of your ideas!!
    Gejala, Tanda Dan Ciri Mata Katarak

    ReplyDelete
  9. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post.Visit our website at buah mulberry untuk menguruskan badan

    ReplyDelete
  10. Jelly Gamat QnC, obat sinusitis kronis pada anak, obat pilek anak dan bayi yang alami very potent and safe for children and babies, healthy children happy heart always. thanks.

    ReplyDelete
  11. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post.Visit our website at pengobatan kesemutan pada penderita diabetes

    ReplyDelete
  12. https://manfaatgaraminggrisuntukobatbatuempedu.wordpress.com/

    ReplyDelete
  13. https://caramengobatipenyumbatandiprostatsecaraalami.wordpress.com/

    ReplyDelete
  14. Triflex Capsule Green World ini mengandung bahan alami Ekstrak Radix Astragali, Rhizoma Atractylodis, Rhizoma Drynariae dan Kalsium Karbonat yang berkualitas dan benar benar sudah teruji dan terjamin aman terbukti ampuh tanpa efek samping. Penelitian membuktikan bahwa Triflex Capsule Green World dapat membantu mengatasi nyeri sendi.

    ReplyDelete
  15. Gejala Dan Penyebab Penebalan Dinding Rahim Pada wanita - Rahim merupakan organ reproduksi wanita yang bertanggung jawab untuk beberapa fungsi reproduksi, termasuk menstruasi, implantasi, kehamilan, persalinan, dan pengiriman.

    ReplyDelete
  16. Gejala Dan Penyebab Penebalan Dinding Rahim Pada wanita - Rahim merupakan organ reproduksi wanita yang bertanggung jawab untuk beberapa fungsi reproduksi, termasuk menstruasi, implantasi, kehamilan, persalinan, dan pengiriman.

    ReplyDelete
  17. Cosmetic breast augmentation endoscopic approach is aesthetic breast augmentation endoscopic application obat herbal untuk memperbaiki fungsi hati ( liver ) of modern equipment magnified crisp structure chest cavity, making dissection padded breasts and put the bag inside an easy and accurate , less invasive.

    ReplyDelete
  18. Cara Memperbaiki Saraf Mata Yang Rusak Dengan Cepat & Mudah – Mata merupakan salah satu organ sensorik yang paling kompleks dan penting dalam tubuh manusia. Hal ini karena mata menyediakan kemampuan untuk melihat dalam cahaya cerah dan redup, fokus pada objek baik dekat maupun jauh.

    ReplyDelete
  19. Triflex Capsule Green World ini mengandung bahan alami Ekstrak Radix Astragali, Rhizoma Atractylodis, Rhizoma Drynariae dan Kalsium Karbonat yang berkualitas dan benar benar sudah teruji dan terjamin aman terbukti ampuh tanpa efek samping. Penelitian membuktikan bahwa Triflex Capsule Green World dapat membantu mengatasi nyeri sendi.

    ReplyDelete
  20. Daun sirsak dikenal sebagai obat herbal alami. Hal ini karena Daun sirsak mengandung senyawa alami tertentu yang dapat bermanfaat untuk pengobatan berbagai penyakit terutama masalah pada organ kewanitaan.

    ReplyDelete
  21. Blueberry Juice Green World merupakan produk suplemen herbal terbaik yang diformulasikan untuk anda yang menginginkan kesehatan tubuh yang sehat dan terjaga dari berbagai penyakit.Blueberry Juice Green World merupakan produk suplemen herbal terbaik yang diformulasikan untuk anda yang menginginkan kesehatan tubuh yang sehat dan terjaga dari berbagai penyakit.

    ReplyDelete
  22. students can enjoy these modern learning facilities and, what is more, important not always such conditions can be arranged. Apa saja gejala yang ditimbulkan dari penyakit herpes ? But what can be done is to ensure simple but very vital aspects like physical classroom conditions that influence learning process most notably.

    ReplyDelete
  23. Sono molto felice di leggere questo. Questo è il tipo di manuale che deve essere data e non la disinformazione casuale che è agli altri blog. Apprezzare la vostra condivisione questo migliore distacco.

    ReplyDelete
  24. The suitable light from the right area makes kitchen's more big and less of any chore. Obat Herpes Herbal Terbaik It could possibly even help in reducing the possibility of damages.

    ReplyDelete
  25. HubSpot provides advanced targeting marketing and lead nurturing features. This module integrates with Webform and the HubSpot API to submit Webforms directly to HubSpot's lead management system.
    berapakah normal kadar asam urat ?
    manfaat daun salam untuk menurunkan kolesterol
    For example, a Webform-based contact form on your site can send its data to HubSpot, where you may already track potential clients and contacts; or a Webform-based e-newsletter signup could send the lead to HubSpot's targeted marketing system, letting you use your pre-existing email campaigns.

    ReplyDelete
  26. A good informative post that you have shared and thankful your work for sharing Cara Mengeringkan Luka Pasca Operasi Caesar Dengan Cepat information. I appreciate your efforts and all the best. Got some appealing information and would like to give it a try. Applaud your work and keep sharing Cara Mengobati Luka Bakar Melepuh Dengan Cepat Dan Mudah information. When people visit your page and see that you have a lot of followers.

    ReplyDelete