Flycast gRPC connection doesn't work

I have two apps frontend(nodejs) and backend(go)

backend

[[services]]
  processes = ["app"]
  auto_stop_machines = false
  auto_start_machines = true
  min_machines_running = 1
  protocol = "tcp"
  [[services.ports]]
    internal_port = 8080
    port = 8080
  [[services.ports]]
    internal_port = 8000
    port = 8000

frontend add to backend is backend.flycast:8000

If frontend calls backend I see errors on backend

[PP02] could not proxy TCP data to/from instance: failed to copy (direction=client->server, op=write, error=Broken pipe (os error 32))

on frontend

details: 'Received RST_STREAM with code 2 triggered by internal client error: Protocol error'

if I change backend address to backend.internal:8000 on frontend side then everything works as expected.

What is a problem can be?

I updated nodejs to 22 version, change to protobuf-ts some functions but result is same.

I tried with handlers = [“http”] it does not work also.
error log is different but it point is same problem I guess

2024-11-21T21:22:04.126 proxy[2867609ce14368] iad [error] [PU02] could not complete HTTP request to instance: http2 error: connection error detected: frame with invalid size

I found a problem -) it looks it is my fault.
Maybe someone can help me write config for my app.

I have the app with two ports 8000 for grpc and 8080 for http

How should config look for this app?

my app redirect all calls from flycast to only 8080 port by I need redirections from 8080->8080 and 8000->8000

thx

Here is working config(main part):

[[services]]
  internal_port = 8080
  processes = ["app"]
  auto_stop_machines = "stop"
  auto_start_machines = true
  min_machines_running = 0
  protocol = "tcp"

  [[services.ports]]
    handlers = ["http"]
    port = 8080


[[services]]
  internal_port = 8000
  processes = ["app"]
  auto_stop_machines = "stop"
  auto_start_machines = true
  min_machines_running = 0
  protocol = "tcp"

  [[services.ports]]
    handlers = ["http"]
    port = 8000
    [services.ports.http_options]
      h2_backend = true

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.