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

New relay "api": HTTP REST API #2066

Open
flashcode opened this issue Feb 1, 2024 · 0 comments
Open

New relay "api": HTTP REST API #2066

flashcode opened this issue Feb 1, 2024 · 0 comments
Assignees
Labels
feature New feature request in progress Someone is working on this issue
Milestone

Comments

@flashcode
Copy link
Member

flashcode commented Feb 1, 2024

Feature description

Add a new relay protocol called "api", with the following goals:

  • easy client implementation: HTTP REST API, JSON input/output
  • data synchronization: real-time sync with websocket or polling with HTTP requests
  • no internal structures exposed: ANSI color codes, no use of pointers & complex structures like hdata
  • WeeChat itself can connect to another WeeChat using this protocol (also known as relay "remote")

Specification: https://specs.weechat.org/specs/2023-005-relay-http-rest-api.html

@flashcode flashcode added the feature New feature request label Feb 1, 2024
@flashcode flashcode added this to the 4.3.0 milestone Feb 1, 2024
@flashcode flashcode self-assigned this Feb 1, 2024
flashcode added a commit that referenced this issue Feb 1, 2024
@flashcode flashcode added the in progress Someone is working on this issue label Feb 2, 2024
flashcode added a commit that referenced this issue Feb 2, 2024
…l builds (issue #2066)

This is because in these versions the libcjson-dev package doesn't provide
pkg-config file.
flashcode added a commit that referenced this issue Apr 7, 2024
flashcode added a commit that referenced this issue Apr 7, 2024
Connection to remote:

- handshake: offer support for all supported hash algorithms
- network connect with a socket
- upgrade to websocket and authenticate with remote (password/TOTP)
- check websocket response
- get list of buffers (not used yet)

Note: connection to remote with TLS or a proxy is not yet supported.
flashcode added a commit that referenced this issue Apr 7, 2024
flashcode added a commit that referenced this issue Apr 7, 2024
This can be used to send raw JSON data encapsulated in a websocket frame to the
remote.

Example: /remote send test {"request":"GET /api/version"}
flashcode added a commit that referenced this issue Apr 7, 2024
flashcode added a commit that referenced this issue Apr 7, 2024
flashcode added a commit that referenced this issue Apr 7, 2024
flashcode added a commit that referenced this issue Apr 7, 2024
This allows buffers to get any user input, including commands, that are sent to
the buffer callback instead of being executed on the buffer.
flashcode added a commit that referenced this issue Apr 7, 2024
…otocols (issue #2066)

This is to prevent infinite loop when connected to a remote which is the
weechat instance itself.
flashcode added a commit that referenced this issue Apr 7, 2024
…instead of NULL (issue #2066)

This fixes the websocket connection to remote that is not initiated after the
successful handshake with the remote relay/api.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request in progress Someone is working on this issue
Projects
None yet
Development

No branches or pull requests

1 participant