Skip to content

zshao/thriftproxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

thriftproxy

A simple thrift proxy in Python. Handy for intercepting and logging Thrift calls over the network.

Prerequisites

  • thrift

Kind of obvious, but you need the Python thrift package. You’ll also need the thrift compiler.

  • docopt

Used for cli documentation. Truly the only way to do command line argument parsing

Setup

Generate Thrift Python code
The proxy uses the Python code generated by your thrift compiler, so you’ll need to generate that code.
Add Generated code to sys.path
This is a simple program that relies on Python’s import logic to find the thrift code, so you’l need to add it yourself.
Start the Thrift service
Spin up the “real” Thrift server you want to proxy.
Start the proxy
Follow the usage directions built in to the script.
python thriftproxy.py cql.cassandra.Cassandra.Client 9161 9160
Done
You can now hit the proxy as though it was the Thrift service

About

A simple Thrift proxy in Python. Handy for intercepting and logging Thrift calls over the network.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%