Skip to content

Commit

Permalink
Merging 5be2973 into trunk-temp/pr-1201/11320499-b336-4dd6-ae8b-61da3…
Browse files Browse the repository at this point in the history
…f79d54c
  • Loading branch information
trunk-io[bot] authored Jul 31, 2024
2 parents e44d81d + 5be2973 commit 9823779
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion transport/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
import { createConnectTransport } from "@connectrpc/connect-node";
import {
createConnectTransport,
Http2SessionManager,
} from "@connectrpc/connect-node";

export function createTransport(baseUrl: string) {
// We create our own session manager so we can attempt to pre-connect
const sessionManager = new Http2SessionManager(baseUrl, {
// AWS ALB doesn't support PING so we use a very high idle timeout
idleConnectionTimeoutMs: 600 * 1000,
});

// We ignore the promise result because this is an optimistic pre-connect
sessionManager.connect();

return createConnectTransport({
baseUrl,
httpVersion: "2",
sessionManager,
});
}

0 comments on commit 9823779

Please sign in to comment.