This repository was archived by the owner on Mar 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathsignalr_client_config.h
42 lines (33 loc) · 1.92 KB
/
signalr_client_config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#pragma once
#include "cpprest/http_client.h"
#include "cpprest/ws_client.h"
#include "_exports.h"
namespace signalr
{
class signalr_client_config
{
public:
signalr_client_config();
SIGNALRCLIENT_API void __cdecl set_proxy(const web::web_proxy &proxy);
// Please note that setting credentials does not work in all cases.
// For example, Basic Authentication fails under Win32.
// As a workaround, you can set the required authorization headers directly
// using signalr_client_config::set_http_headers
SIGNALRCLIENT_API void __cdecl set_credentials(const web::credentials &credentials);
SIGNALRCLIENT_API web::http::client::http_client_config __cdecl get_http_client_config() const;
SIGNALRCLIENT_API void __cdecl set_http_client_config(const web::http::client::http_client_config& http_client_config);
SIGNALRCLIENT_API web::websockets::client::websocket_client_config __cdecl get_websocket_client_config() const;
SIGNALRCLIENT_API void __cdecl set_websocket_client_config(const web::websockets::client::websocket_client_config& websocket_client_config);
SIGNALRCLIENT_API web::http::http_headers __cdecl get_http_headers() const;
SIGNALRCLIENT_API void __cdecl set_http_headers(const web::http::http_headers& http_headers);
SIGNALRCLIENT_API const utility::string_t& __cdecl get_user_agent() const;
SIGNALRCLIENT_API void __cdecl set_user_agent(const utility::string_t &user_agent_string);
private:
web::http::client::http_client_config m_http_client_config;
web::websockets::client::websocket_client_config m_websocket_client_config;
web::http::http_headers m_http_headers;
utility::string_t m_user_agent_string;
};
}