Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add websockets transport mechanism to MQTT #15600

Open
5 of 10 tasks
VideoCurio opened this issue Dec 19, 2024 · 4 comments · May be fixed by #15601
Open
5 of 10 tasks

Add websockets transport mechanism to MQTT #15600

VideoCurio opened this issue Dec 19, 2024 · 4 comments · May be fixed by #15601
Labels
enhancement New feature or request

Comments

@VideoCurio
Copy link

Describe what you are trying to accomplish and why in non technical terms
Add a websockets transport option for MQTT.

Describe the solution you'd like
An MQTT server is not always reachable only as raw TCP on port 1881; it can also be accessed as a WebSocket server, sometimes even behind a reverse proxy with TLS. Paho MQTT supports this feature, as does Mosquitto.

Describe alternatives you've considered

Additional context
I have write a patch that solve this: Add_websockets_transport_mechanism_to_MQTT_.patch.txt. The default transport option was set to 'tcp', so this change will not affect an already configured Frigate app.

The configuration change is validated using a call to a pydantic library field validator.

This patch has been tested with Mosquitto 1.6 and 2.0, as well as with a server behind a reverse proxy on port 443 (requiring a TLS connection).

The docs/configuration/reference.md file has also been updated to reflect this change.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code
  • Documentation Update

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • The code has been formatted using Ruff (ruff format frigate)
@VideoCurio VideoCurio added the enhancement New feature or request label Dec 19, 2024
@hawkeye217
Copy link
Collaborator

Is there a reason why you didn't create this as a PR?

@VideoCurio
Copy link
Author

I tried to do a PR first, I am using Jetbrains Pycharm and got denied. Request response: Access to site has been restricted.
Even if I am well logged with github account :scratching_head:

@NickM-27
Copy link
Collaborator

You need to push to your fork and then create a PR from the fork to frigate. Can be done in the github ui.

VideoCurio added a commit to VideoCurio/frigate that referenced this issue Dec 19, 2024
## Proposed change
Add websockets transport mechanism to MQTT.

An MQTT server is not always reachable only as raw TCP on port 1881; it can also be accessed as a WebSocket server, sometimes even behind a reverse proxy with TLS. Paho MQTT supports this feature, as does Mosquitto.

The default transport option was set to 'tcp', so this change will not affect an already configured Frigate app.

The configuration change is validated using a call to a pydantic library field validator.

This patch has been tested with Mosquitto 1.6 and 2.0, as well as with a server behind a reverse proxy on port 443 (requiring a TLS connection).

The docs/configuration/reference.md file has also been updated to reflect this change.

## Type of change

- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code
- [x] Documentation Update

## Additional information

- This PR fixes or closes issue: fixes blakeblackshear#15600
- This PR is related to issue:

## Checklist

- [x] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [x] There is no commented out code in this PR.
- [x] The code has been formatted using Ruff (`ruff format frigate`)
@VideoCurio VideoCurio linked a pull request Dec 19, 2024 that will close this issue
10 tasks
@VideoCurio
Copy link
Author

Ok PR published. Thanks @NickM-27 for the advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants