https://github.com/getlarge/aedes-proxy
Testing aedes behind a proxy
https://github.com/getlarge/aedes-proxy
Last synced: about 1 year ago
JSON representation
Testing aedes behind a proxy
- Host: GitHub
- URL: https://github.com/getlarge/aedes-proxy
- Owner: getlarge
- Created: 2020-01-28T09:50:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-07T21:08:07.000Z (about 3 years ago)
- Last Synced: 2025-02-14T06:52:44.880Z (over 1 year ago)
- Language: JavaScript
- Size: 274 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Aedes proxy example
## Steps
1 Generate certicates with `generate-cert.sh`
( if FQDN is set to something else than localhost, update docker-compose.yml NGINX_SERVER_HOST accordingly)
2 `docker-compose build`
3 `docker-compose up`
3 Start `node client.js`
## Expected behaviour
Protocol decoder should be triggered only once when using TCP proxy that handles SSL termination.
## Current behaviour
Protocol decoder is randomly triggered twice.
It might be a bug in the `lib/client.js`, `nextBatch` function ?

## Possible solution
Inside `!client.connackSent && client.broker.trustProxy && buf` condition block
```js
var { data, isProxy } = client.broker.decodeProtocol(client, buf)
if (data) {
client._parser.parse(data)
} else if (!isProxy) {
client._parser.parse(buf)
}
```