I need to connect a grpc server with some metadata ,such as username and password.From the grpc Docs,the PHP code is clear,I think this code will work:
$client = new Routeguide\RouteGuideClient('test.yintongzhibo.com:9002', [
'credentials' => Grpc\ChannelCredentials::createSsl(file_get_contents("xxx.pem")),
'update_metadata' => $metaProcessor,
'grpc.ssl_target_name_override' => 'test.yintongzhibo.com',]);
$metaProcessor = function($metadata,$client = []){
$values = $metadata;
$values[Username] = ['xxx'];
$values[Password] = ['yyy'];
return $values;}
list($resp,$status) = $client->getMarketData(request)->wait();
But I need to achieve the same thing in python.Python Docs is not very clear,so how to write the python code to do the same thing that the PHP code does?