diff --git a/src/adapters/http/client.ts b/src/adapters/http/client.ts index 23696796f..18a9d5197 100644 --- a/src/adapters/http/client.ts +++ b/src/adapters/http/client.ts @@ -23,7 +23,7 @@ class HttpClientAdapter extends Adapter { let headers = {} const authConfig = await clientAuthConfig(this.serverName) const serverUrl = this.serverUrlExpanded - for (const channelName of this.channelNames) { + for (const channelName of this.channelAddresses) { const channelInfo = this.parsedAsyncAPI.channels().get(channelName) const httpChannelBinding = channelInfo.bindings().get('http') const channelServers = channelInfo.servers().all().map(e => e.id()) @@ -31,7 +31,7 @@ class HttpClientAdapter extends Adapter { !channelServers.length || channelServers.includes(message.serverName) if (httpChannelBinding && isChannelServers) { const method = httpChannelBinding.json().method - let url = `${serverUrl}/${channelName}` + let url = new URL(this.AsyncAPIServer.url() + this.parsedAsyncAPI.channels().get(channelName).address()) const gleeAuth = new GleeAuth( this.AsyncAPIServer, this.parsedAsyncAPI, diff --git a/src/adapters/ws/client.ts b/src/adapters/ws/client.ts index 6fa9fe188..263844fb8 100644 --- a/src/adapters/ws/client.ts +++ b/src/adapters/ws/client.ts @@ -38,7 +38,7 @@ class WsClientAdapter extends Adapter { this.serverName, authConfig ) - let url = new URL(this.AsyncAPIServer.url() + channel) + let url = new URL(this.AsyncAPIServer.url() + this.parsedAsyncAPI.channels().get(channel).address()) if (authConfig) { const modedAuth = await gleeAuth.processClientAuth(url, headers, {}) headers = modedAuth.headers diff --git a/src/lib/adapter.ts b/src/lib/adapter.ts index 6f6115f65..c3fd26900 100644 --- a/src/lib/adapter.ts +++ b/src/lib/adapter.ts @@ -52,7 +52,7 @@ class GleeAdapter extends EventEmitter { this._AsyncAPIServer = server this._parsedAsyncAPI = parsedAsyncAPI - this._channelNames = this._parsedAsyncAPI.channels().all().map(e => e.address()) + this._channelNames = this._parsedAsyncAPI.channels().all().map(e => e.id()) this._channelAddresses = this._parsedAsyncAPI.channels().all().map(c => c.address()) this._connections = []