コード例 #1
0
        public void HttpsUriWithDefaultPort()
        {
            var log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod());
            log.Info("Start");

            var options = new Transport.Options();
            options.Path = "/engine.io";
            options.Hostname = this.CreateOptions().Hostname;
            options.Secure = true;
            options.Query = new Dictionary<string, string> {{"sid", "test"}};
            options.TimestampRequests = false;
            options.Port = 443;
            var polling = new Polling(options);
            //Assert.Contains("https://localhost/engine.io?sid=test&b64=1", polling.Uri());
            var expected = string.Format("https://{0}/engine.io?sid=test&b64=1", options.Hostname);
            Assert.Contains(expected, polling.Uri());
        }
コード例 #2
0
 public SendEncodeCallback(Polling polling) {
     this.polling = polling;
 }
コード例 #3
0
 public CloseListener(Polling polling) {
     this.polling = polling;
 }
コード例 #4
0
 public DecodePayloadCallback(Polling polling) {
     this.polling = polling;
 }
コード例 #5
0
 public SendEncodeCallback(Polling polling)
 {
     this.polling = polling;
 }
コード例 #6
0
 public CloseListener(Polling polling)
 {
     this.polling = polling;
 }
コード例 #7
0
 public DecodePayloadCallback(Polling polling)
 {
     this.polling = polling;
 }
コード例 #8
-2
        public void TimestampedUri()
        {
            var log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod());
            log.Info("Start");

            var options = new Transport.Options();
            options.Path = "/engine.io";
            options.Hostname = "test";
            options.Secure = false;
            options.Query = new Dictionary<string, string> {{"sid", "test"}};
            options.TimestampRequests = true;
            options.TimestampParam = "t";
            var polling = new Polling(options);

            string pat = @"http://test/engine.io\?sid=test&(t=[0-9]+-[0-9]+)";
            var r = new Regex(pat, RegexOptions.IgnoreCase);
            var test = polling.Uri();
            log.Info(test);
            Match m = r.Match(test);
            Assert.True(m.Success);
        }