This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/compression.go b/compression.go | |
| index 813ffb1..4c492e0 100644 | |
| --- a/compression.go | |
| +++ b/compression.go | |
| @@ -41,16 +41,47 @@ func isValidCompressionLevel(level int) bool { | |
| return minCompressionLevel <= level && level <= maxCompressionLevel | |
| } | |
| -func compressNoContextTakeover(w io.WriteCloser, level int) io.WriteCloser { | |
| +// FlateWriter ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package timers | |
| import ( | |
| "sync" | |
| "time" | |
| ) | |
| var timerPool sync.Pool | |
| // AcquireTimer from pool. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func BenchmarkUpgrade(b *testing.B) { | |
| br := bufio.NewReaderSize(strings.NewReader(""), 4096) | |
| bw := bufio.NewWriterSize(&bytes.Buffer{}, 4096) | |
| upgrader := Upgrader{ | |
| ReadBufferSize: 0, | |
| WriteBufferSize: 0, | |
| } | |
| resp := &reuseTestResponseWriter{ | |
| brw: bufio.NewReadWriter(br, bw), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <!-- Обратите внимание, что клиент тут импортируется из ветки c2 репозитория centrifuge-js --> | |
| <script type="text/javascript" src="https://rawgit.com/centrifugal/centrifuge-js/c2/dist/centrifuge.min.js"></script> | |
| </head> | |
| <body> | |
| <input type="text" id="input" /> | |
| <script type="text/javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| events { | |
| } | |
| http { | |
| log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
| '$status $body_bytes_sent "$http_referer" ' | |
| '"$http_user_agent"'; | |
| map $http_upgrade $connection_upgrade { | |
| default upgrade; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var centrifuge = new Centrifuge("ws://localhost:8000/connection/websocket"); | |
| centrifuge.on("connect", function() { | |
| centrifuge.rpc({"input": "test"}).then(function(data){ | |
| console.log(data); | |
| }, function(err) { | |
| console.log(err); | |
| }) | |
| }); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "log" | |
| "net/http" | |
| "github.com/centrifugal/centrifuge" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax = "proto3"; | |
| package proto; | |
| message Error { | |
| uint32 Code = 1; | |
| string Message = 2; | |
| } | |
| enum MethodType { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| // Demonstrate how to reconnect. | |
| import ( | |
| "fmt" | |
| "log" | |
| "time" | |
| "github.com/centrifugal/centrifuge-mobile" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- gets all fields from a hash as a dictionary | |
| local hgetall = function (key) | |
| local bulk = redis.call('HGETALL', key) | |
| local result = {} | |
| local nextkey | |
| for i, v in ipairs(bulk) do | |
| if i % 2 == 1 then | |
| nextkey = v | |
| else | |
| result[nextkey] = v |