good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
chat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
github
tinode
chat
Commits
e27e4ef4
Commit
e27e4ef4
authored
2 years ago
by
or-else
Browse files
Options
Downloads
Patches
Plain Diff
make websocket per-message compression optional
parent
14662265
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
server/hdl_websock.go
+1
-1
1 addition, 1 deletion
server/hdl_websock.go
server/main.go
+9
-0
9 additions, 0 deletions
server/main.go
server/tinode.conf
+4
-0
4 additions, 0 deletions
server/tinode.conf
with
14 additions
and
1 deletion
server/hdl_websock.go
+
1
−
1
View file @
e27e4ef4
...
@@ -159,7 +159,7 @@ func wsWrite(ws *websocket.Conn, mt int, msg any) error {
...
@@ -159,7 +159,7 @@ func wsWrite(ws *websocket.Conn, mt int, msg any) error {
var
upgrader
=
websocket
.
Upgrader
{
var
upgrader
=
websocket
.
Upgrader
{
ReadBufferSize
:
1024
,
ReadBufferSize
:
1024
,
WriteBufferSize
:
1024
,
WriteBufferSize
:
1024
,
EnableCompression
:
true
,
EnableCompression
:
globals
.
wsCompression
,
// Allow connections from any Origin
// Allow connections from any Origin
CheckOrigin
:
func
(
r
*
http
.
Request
)
bool
{
return
true
},
CheckOrigin
:
func
(
r
*
http
.
Request
)
bool
{
return
true
},
}
}
...
...
This diff is collapsed.
Click to expand it.
server/main.go
+
9
−
0
View file @
e27e4ef4
...
@@ -195,6 +195,9 @@ var globals struct {
...
@@ -195,6 +195,9 @@ var globals struct {
// ICE servers config (video calling)
// ICE servers config (video calling)
iceServers
[]
iceServer
iceServers
[]
iceServer
// Websocket per-message compression negotiation is enabled.
wsCompression
bool
}
}
// Credential validator config.
// Credential validator config.
...
@@ -245,6 +248,9 @@ type configType struct {
...
@@ -245,6 +248,9 @@ type configType struct {
ApiPath
string
`json:"api_path"`
ApiPath
string
`json:"api_path"`
// Cache-Control value for static content.
// Cache-Control value for static content.
CacheControl
int
`json:"cache_control"`
CacheControl
int
`json:"cache_control"`
// If true, do not attempt to negotiate websocket per message compression (RFC 7692.4).
// It should be disabled (set to true) if you are using MSFT IIS as reverse proxy.
WSCompressionDisabled
bool
`json:"ws_compression_disabled"`
// Address:port to listen for gRPC clients. If blank gRPC support will not be initialized.
// Address:port to listen for gRPC clients. If blank gRPC support will not be initialized.
// Could be overridden from the command line with --grpc_listen.
// Could be overridden from the command line with --grpc_listen.
GrpcListen
string
`json:"grpc_listen"`
GrpcListen
string
`json:"grpc_listen"`
...
@@ -545,6 +551,9 @@ func main() {
...
@@ -545,6 +551,9 @@ func main() {
globals
.
defaultCountryCode
=
defaultCountryCode
globals
.
defaultCountryCode
=
defaultCountryCode
}
}
// Websocket compression.
globals
.
wsCompression
=
!
config
.
WSCompressionDisabled
if
config
.
Media
!=
nil
{
if
config
.
Media
!=
nil
{
if
config
.
Media
.
UseHandler
==
""
{
if
config
.
Media
.
UseHandler
==
""
{
config
.
Media
=
nil
config
.
Media
=
nil
...
...
This diff is collapsed.
Click to expand it.
server/tinode.conf
+
4
−
0
View file @
e27e4ef4
...
@@ -15,6 +15,10 @@
...
@@ -15,6 +15,10 @@
//
Cache
-
Control
header
for
static
content
in
seconds
.
39600
is
11
hours
.
//
Cache
-
Control
header
for
static
content
in
seconds
.
39600
is
11
hours
.
"cache_control"
:
39600
,
"cache_control"
:
39600
,
//
If
true
,
do
not
attempt
to
negotiate
websocket
per
message
compression
(
RFC
7692
.
4
).
//
It
should
be
disabled
(
set
to
true
)
if
you
are
using
MSFT
IIS
as
a
reverse
proxy
.
"ws_compression_disabled"
:
false
,
//
URL
path
for
mounting
the
directory
with
static
files
.
//
URL
path
for
mounting
the
directory
with
static
files
.
"static_mount"
:
"/"
,
"static_mount"
:
"/"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment