SignalR Core的TransportType websocket协议(从alpha2迁移到1.0.0)

时间:2018-06-09 07:55:08

标签: signalr asp.net-core-signalr

如何从ASP.NET Core 2.1

连接到SignalR Core 1.0.0时定义TransportType

1.0.0-alpha2-final我有这段代码:

import { HubConnection, TransportType } from "@aspnet/signalr-client";

this.hub = new HubConnection(`/HUB/${url}`, { transport: TransportType.WebSockets});

我找到了1.0.0 here的示例:

import { HubConnection, HubConnectionBuilder } from "@aspnet/signalr";

        this.hub = new HubConnectionBuilder()
            .withUrl(`/HUB/${url}`)
            .build();

但不知道如何定义TransportType WebSockets

0 个答案:

没有答案