litespeedtech / litespeedtech/openlitespeed

OpenLiteSpeed Websocket & Chatwoot

Open
#352 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.5k
Forks
233
Avg merge
2d 19h
Merged PRs (30d)
5

Description

OS: Ubuntu 20
OpenLiteSpeed 1.7.16
Cyberpanel: 2.3 Build 2

Hey,

i am struggling with setting up a right configuration to let OpenLiteSpeed work with Chatwoot.

Chatwoot's client integration tries to connect with websocket via following request: wss://domain/cable.
The access log returns code 101 for accepting the upgrade request.
And than there is NOTHING. The request seems to end in a blockhole.

I have tried a lot to achieve a request which could reach the backend but nothing helped.

backend is running on port 3001 which i want to reach.

Configuration for proxy which works fine. Frontend and backend of Chatwoot are communicating.

extprocessor backend {
type proxy
address http://127.0.0.1:3001
maxConns 1000
pcKeepAliveTimeout 3200
initTimeout 60
retryTimeout 10
respBuffer 0
}

context / {
type proxy
handler backend

accessControl {
allow *
}
addDefaultCharset on
defaultCharsetCustomized utf-8
enableIpGeo 0
}

For the websocket i have tried also a lot of tricks like:

htaccess rules:
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteCond %{REQUEST_URI} ^/cable
RewriteRule /(.*) wss://wssbackend/$1 [P]
and some more variations. But it is not redirecting to backend.

If i try to connect with a websocket test tool directly to the port like: wss://domain:3001/cable
The backend tells me that this this request is not secure and well format (because some headers are missing and its bypassing ssl). This response let me know that all other trials just did not redirect the wss request to backend the right way.

I also have tried to use the websocket option of OpenLiteSpeed without success

websocket /cable {
address 127.0.0.1:3001
}

websocket /{
address 127.0.0.1:3001
}

Are there any other possibilities?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the OpenLiteSpeed websocket /cable configuration and the supplied proxy extprocessor, then reproduce the wss://domain/cable request while comparing access and backend behavior. Done means the upgrade is forwarded to 127.0.0.1:3001 with the required headers and Chatwoot establishes its websocket connection.

Written by the indexing model from the issue text.

Assessment

Tech stack
ubuntu
Domain
backend, networking
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.