import grpc from ‘k6/net/grpc’;
import { check, sleep } from ‘k6’;
export const options = {
insecureSkipTLSVerify: true,
};
const client = new grpc.Client();
client.load([‘definitions’], ‘Account.proto’);
export default () => {
client.connect(‘host:443’, {
plaintext: true
});
const data = {
“id”: “”,
“password”: “”,
};
const response = client.invoke(‘AccountProtoService/SignIn’, data);
check(response, {
‘status is OK’: (r) => r && r.status === grpc.StatusOK,
});
console.log(JSON.stringify(response.message));
client.close();
sleep(1);
};
simple request failing in prod stag environment but working perfectly in local.
When running script in prod with plaintext : false it gives error
{“message”:{“message”:“”,“success”:false},“error”:{“code”:2,“message”:“unexpected HTTP status code received from server: 426 (Upgrade Required); malformed header: missing HTTP content-type”,“details”:},“headers”:{},“trailers”:{},“status”:2} source=console
with plaintext:true it timeouts after 1 min giving error
ERRO[0060] GoError: context deadline exceeded: connection error: desc = “error reading server preface: read tcp 10.X.X.X:XXXX->20.X.X.X:X: use of closed network connection”
running at reflect.methodValueCall (native)
I am using .net 8 for my backend grpc server any help would be appreciated thanx