1

I am facing an issue while connecting SignalR from client. I got this error "None of the transports supported by the client are supported by the server.". Also it should GET request instead of log says it's a POST request.

Code:

final httpConnectionOptions = HttpConnectionOptions(
      /*httpClient: WebSupportingHttpClient(logger,
          httpClientCreateCallback: _httpClientCreateCallback),*/
      logger: logger,
      //logMessageContent: true,
      //transport: HttpTransportType.ServerSentEvents,
      //skipNegotiation: true,
    );
    _hubConnection = HubConnectionBuilder()
        .withUrl(
          _serverUrl + formData,
          options: httpConnectionOptions,
          //transportType: HttpTransportType.ServerSentEvents,
        )
        .withAutomaticReconnect()
        //.withAutomaticReconnect(retryDelays: [2000, 5000, 10000, 20000])
        .configureLogging(logger)
        .build();
    _hubConnection.onclose(({error}) => connectionIsOpen = false);

Log:

I/flutter (31934): Starting HubConnection.
I/chatty  (31934): uid=10154 1.ui identical 11 lines
I/flutter (31934): Starting HubConnection.
I/flutter (31934): Starting connection with transfer format 'TransferFormat.Text'.
I/chatty  (31934): uid=10154(com.ci.radico.radico) 1.ui identical 11 lines
I/flutter (31934): Starting connection with transfer format 'TransferFormat.Text'.
I/flutter (31934): Sending negotiation request: <host>/signalr/negotiate?<data>&negotiateVersion=1
I/chatty  (31934): uid=10154() 1.ui identical 11 lines
I/flutter (31934): Sending negotiation request: <host>/signalr/negotiate?<data>&negotiateVersion=1
I/flutter (31934): HTTP send: url '<host>/signalr/negotiate?<data>&negotiateVersion=1', method: 'POST' content: '' content length = '0' headers: '{ content-type: text/plain;charset=UTF-8 }, { X-Requested-With: FlutterHttpClient }'
I/chatty  (31934): uid=10154(com.ci.radico.radico) 1.ui identical 11 lines
I/flutter (31934): HTTP send: url 'https://ps360ordersapi.ci-private-ase.p.azurewebsites.net/signalr/negotiate?<data>&negotiateVersion=1', method: 'POST' content: '' content length = '0' headers: '{ content-type: text/plain;charset=UTF-8 }, { X-Requested-With: FlutterHttpClient }'
I/flutter (31934): Failed to start the connection: None of the transports supported by the client are supported by the server.
I/chatty  (31934): uid=10154() 1.ui identical 11 lines
I/flutter (31934): Failed to start the connection: None of the transports supported by the client are supported by the server.
I/flutter (31934): HubConnection failed to start successfully because of error 'None of the transports supported by the client are supported by the server.'.
I/chatty  (31934): uid=10154() 1.ui identical 11 lines
I/flutter (31934): HubConnection failed to start successfully because of error 'None of the transports supported by the client are supported by the server.'.
E/flutter (31934): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: None of the transports supported by the client are supported by the server.
E/flutter (31934): 
Zahra
  • 2,231
  • 3
  • 21
  • 41
Tejas
  • 11
  • 1

1 Answers1

-1

Specifically for Azure, web sockets has to be explicitly enabled.

Frank M
  • 1,379
  • 9
  • 18
  • This is wrong, the issue you linked is specific to using Blazor. The OP is not using blazor because blazor manages the SignalR connection for you, if you're making your own SignalR connection you aren't hitting the same code path that Blazor is. – Brennan Jan 28 '22 at 16:13
  • The WebSockets part is partially accurate. You should explicitly enable WebSockets on your Azure App Service site, but technically it isn't required (unless the flutter client doesn't support other transports). – Brennan Jan 28 '22 at 16:20
  • I will edit to the partially correct answer. – Frank M Jan 28 '22 at 18:57
  • I tried to enable WebSocket from Azure App Services for requested API host. But it couldn't work. What does it mean "unless the flutter client doesn't support other transports"? – Tejas Jan 29 '22 at 13:13
  • What are the changes to be required from client side as Web App from AngularJS already working fine. – Tejas Jan 29 '22 at 13:14