Preserve original URL

This commit is contained in:
olaservo 2025-04-29 21:32:21 -07:00
commit d16e89df1e

View file

@ -15,7 +15,11 @@ export type TransportOptions = {
function createSSETransport(options: TransportOptions): Transport {
const baseUrl = new URL(options.url ?? "");
// Create new URL while preserving the port from baseUrl
const sseUrl = new URL("/sse", baseUrl);
if (baseUrl.port) {
sseUrl.port = baseUrl.port;
}
return new SSEClientTransport(sseUrl);
}