8000 GitHub - PinkDiamond1/protocol-12: The LocalSend REST API
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PinkDiamond1/protocol-12

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

LocalSend Protocol v1

Discovery

Devices are discovered by sending this request to all local IP addresses.

The fingerprint parameter is optional and is only used to avoid self-discovering. In this case, the server may respond with an error code if sender and receiver fingerprints match. The fingerprint is generated on each app start randomly.

GET /api/localsend/v1/info?fingerprint=abc

Response

{
  "alias": "Nice Orange",
  "deviceModel": "Samsung", // nullable
  "deviceType": "mobile" // mobile | desktop | web
}

Send Request (Metadata only)

Sends only the metadata to the receiver.

The receiver will decide if this request gets accepted, partially accepted or rejected.

Be aware that only one active session is allowed, i.e. the server will reject all requests when another session is ongoing.

POST /api/localsend/v1/send-request

Request

{
  "info": {
    "alias": "Nice Orange",
    "deviceModel": "Samsung", // nullable
    "deviceType": "mobile" // mobile | desktop | web
  },
  "files": {
    "some file id": {
      "id": "some file id",
      "fileName": "my image.png",
      "size": 324242, // bytes
      "fileType": "image", // image | video | pdf | text | other
      "preview": "*preview data*" // nullable
    },
    "another file id": {
      "id": "another file id",
      "fileName": "another image.jpg",
      "size": 1234,
      "fileType": "image",
      "preview": "*preview data*"
    }
  }
}

Response

{
  "some file id": "some token",
  "another file id": "some other token"
}

Send Data

The file transfer.

Use the fileId and its file-specific token from /send-request.

This route can be called in parallel.

POST /api/localsend/v1/send?fileId=some file id&token=some token

Request

Binary data

Response

No body

Cancel

This route will be called when the sender wants to cancel the session.

The server will use the IP address to determine if the request is legitimate.

POST /api/localsend/v1/cancel

Response

No body

About

The LocalSend REST API

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0