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 websocket to API #970

Merged
merged 6 commits into from Jul 12, 2020
Merged

Add websocket to API #970

merged 6 commits into from Jul 12, 2020

Conversation

haykam821
Copy link
Contributor

@haykam821 haykam821 commented Jan 7, 2020

This pull request implements the /api/socket endpoint, which is a websocket.

  • Server → client mirrors /api/stream
  • Client → server mirrors /api/message

bridge/api/api.go Outdated Show resolved Hide resolved
@42wim
Copy link
Owner

42wim commented Jan 8, 2020

Thanks for the PR, looks good.
Take a look at the linting errors in the Travis CI build though.

Co-Authored-By: Wim <wim@42.be>
@haykam821
Copy link
Contributor Author

haykam821 commented Jan 8, 2020

@42wim I'll fix the lint errors.

This is still a draft for now since I haven't implemented the server-bound functionality to send messages to Matterbridge.

@haykam821 haykam821 marked this pull request as ready for review June 26, 2020 09:46
@NikkyAI
Copy link
Contributor

NikkyAI commented Jun 27, 2020

so did the travis-ci crash or what happened ?

@qaisjp
Copy link
Collaborator

qaisjp commented Jun 27, 2020

I don't think we use Travis anymore.

@NikkyAI
Copy link
Contributor

NikkyAI commented Jun 27, 2020

then maybe it should be changed to be not a required check anymore
or is this because this PR is a old draft?

@42wim
Copy link
Owner

42wim commented Jun 28, 2020

Still two linting issues, you can fix those by doing _ = conn.WriteJSON(msg)
As you implemented it now, it's blocking on the reader, so if you as client don't send any messages, you can also read no new messages from matterbridge.

Maybe https://github.com/gorilla/websocket/blob/master/examples/chat/client.go can be an inspiration?

@haykam821 haykam821 requested a review from 42wim July 3, 2020 21:41
@42wim
Copy link
Owner

42wim commented Jul 12, 2020

LGTM, thanks

@42wim 42wim added this to the 1.18.0 milestone Jul 12, 2020
@42wim 42wim merged commit 9b22f16 into 42wim:master Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants