示例#1
0
 public GitterBroker(GitterConfiguration configuration)
 {
     _client = new HttpClient {
         Timeout = TimeSpan.FromMilliseconds(Timeout.Infinite)
     };
     _client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
     _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", configuration.Token);
 }
示例#2
0
        public GitterAdapter(GitterBroker broker, GitterConfiguration configuration, IMessageQueue messageQueue, ILog log)
        {
            _broker       = broker;
            _messageQueue = messageQueue;
            _log          = new AdapterLog("Gitter", log);

            // Create the Bayeux client.
            var settings = new BayeuxClientSettings(new Uri("https://ws.gitter.im/faye"));

            settings.Extensions.Add(new GitterTokenExtension(configuration.Token));
            _bayeux = new BayeuxClient(settings);
        }