question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for application/grpc-web+[proto, json, thrift]

See original GitHub issue

Is your feature request related to a problem? Please describe. load test a web server that runs on grpc-web+[proto, json, thrift] https://github.com/grpc/grpc-web

Describe the solution you’d like we can use “scalapb-grpcweb” for generating Scala sources needed to implement clients for gRPC-web (similar to “scalapb-runtime-grpc”) Similar structure/template that was used for supporting gRPC over http/2.0 i.e

  grpc("Requests 1")
      .rpc(GrpcWeb.METHOD_AUTH)
      .payload(
        AuthRequest(
          email = "sample@gmail.com"
        )
      )
      .header(ReqIdHeader)(Random.alphanumeric take 30 mkString "")

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
phiSgrcommented, Mar 23, 2021

I’m talking about porting this file.

0reactions
UserNoOnecommented, Mar 25, 2021

Finally able to trigger request from Gatling/Scala towards envoy proxy by following procedure mentioned in link

**The body should be the serialized grpc body which is:**
1 byte of zero (not compressed).
network order 4 bytes of proto message length.
serialized proto message.
payload = AuthReq(
        Email="sample@ea.com",
        redirectUri="users-login-page/login",
        pass = "$%FDGD"
    )

val bytes = payload .toByteArray
val length = intToNetworkByteOrder(bytes.length)
var data = new Array[Byte](bytes.length + 5)
data(0) = '\u0000'.toByte
System.arraycopy(length, 0, data, 1, length.length)
System.arraycopy(bytes, 0, data, 5, bytes.length)

def intToNetworkByteOrder(num: Int): Array[Byte] = {
    var localNum = num
    val buf = new Array[Byte](4)
    for (i <- 3 to 0 by -1) {
      buf(i) = (localNum & 0xff).toByte
      localNum >>>= 8
    }
    buf
  }

And finally above data variable is used in Gatling http request body

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Human Readable JSON Endpoints with Thrift (for Free)
Create a way to manually convert between human readable JSON toThrift and vice versa, and maintain it for every single struct, service & ......
Read more >
Transform from thift to json - thrift - Stack Overflow
Perform a command-line transformation -- write a simple compiled Java client that accepts Thrift input and converts it using a JSON ...
Read more >
Json to Thrift with twitter/scrooge - Google Groups
I'm trying to use a simple Thrift structure and the native generated Scala code from twitter/scrooge. Thrift to Scala and back works well....
Read more >
thrift/README.md at master · apache/thrift - js - GitHub
This browser based Apache Thrift implementation supports RPC clients using the JSON protocol over Http[s] with XHR and WebSocket. License. Licensed to the ......
Read more >
JSON RPC vs SOAP vs Apache Thrift What to Use ... - YouTube
Evolution API Server is now Thriftly.io - developed by mertech.complease visit: https://thriftly.ioAs API development continues to grow, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found