Your client would look something like this:
from thrift.transport import THttpClient
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from tutorial import Calculator
transport = THttpClient.THttpClient('https://your-service.com')
transport = TTransport.TBufferedTransport(transport)
protocol = TBinaryProtocol.TBinaryProtocol(transport)
client = Calculator.Client(protocol)
# Connect!
transport.open()
client.ping()
You can stick a proxy in front of your service to terminate the SSL connection and then pass on the http request to your server that looks something like this:
from thrift.protocol import TBinaryProtocol
from thrift.server import THttpServer
from tutorial import CalculatorHandler # assuming you defined this
handler = CalculatorHandler()
processor = Calculator.Processor(handler)
pfactory = TBinaryProtocol.TBinaryProtocolFactory()
server = THttpServer.THttpServer(
processor,
('', 9090),
pfactory
)
print('Starting the server...')
server.serve()
print('done.')