Comments (4)
I believe we should discuss what changes must be made to the API to support tasks first and then decide which way to follow. The result of this discussion should probably end up as a recommended API in the spec.
from saltyrtc-meta.
Another issue: Should we allow sending of strings through the wrapped data channel?
The current browser API supports sending of strings, blobs and arraybuffers. By simply encrypting and passing on data, we can handle arraybuffers, but not the other two. The problem is that we always encrypt bytes. If we encrypt multiple possible types, the receiver must know the type of the encoding.
I'm not sure how the DataChannel itself handles it, but we can't rely on that, as we always send encoded bytes. A workaround would be to prepend an encoding byte to the message before encrypting it.
Status quo: The user can only send binary data. That means that JSON must be manually encoded to UTF-8 on one side and decoded on the other side.
The other option would be to always use msgpack encoding instead of leaving the encoding up to the user. This way the user could also send simple objects directly through the data channel without worrying about encoding. (Note that this is not something that's supported by the data channel API.)
And a third option would be to offer both APIs: The regular secureDataChannel.send(data: ArrayBuffer)
method and additionally a secureDataChannel.sendObject(data: string | object)
method that would use msgpack.
I tend to stick to binary data only. Making it hard to send JSON is the biggest downside though.
from saltyrtc-meta.
The underlying SCTP protocol tells the data channels whether data is binary or string. That doesn't help us though as the data will always be binary.
For me it would be fine to tell the user that we only accept binary for now. I'd also be okay with a task that negotiates this (either binary only or a byte indicating which type is being used). But that's an improvement we can add to the specific task later on.
from saltyrtc-meta.
Let's close this, as the implementations are already done. If the need for API changes arises, we can still open tickets for that.
from saltyrtc-meta.
Related Issues (20)
- Specify recommended exchange message HOT 4
- Post-Release-List HOT 7
- Handover Data Race HOT 1
- End of Candidates HOT 16
- Handover Disable Request HOT 3
- Inconsistency regarding handling of inactive responders HOT 3
- Candidates message example needs update
- Maximum message size can be dropped
- Maximum message size is u64 and may be 0 HOT 1
- ufrag renamed to usernameFragment HOT 1
- onIceCandidatesRemoved HOT 5
- Explain Identity HOT 2
- Accepting message sources other than 0x00 HOT 2
- Msgpack type for binary data HOT 2
- Non-binary websocket messages HOT 1
- Remove send-error message HOT 4
- What is close code 3003 "Handover of the Signalling Channel" being used for? HOT 2
- SaltyRTC and Verifpal HOT 2
- Questions about the protocol HOT 11
- Inconsistency (or unclear text) wrt. closing with an authenticated client. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from saltyrtc-meta.