> On 25 Aug 2015, at 06:38, Bassbouss, Louay <louay.bassbouss@fokus.fraunhofer.de> wrote:
>
> Hello Dave,
>
> Just a comment below on defining priorities for protocol.
>
> I prefer to use array where first element has the highest priority like this:
> [
> {
> "protocol": “ws”,
> "uri" : "ws://www.example.com:8080/webofthings”
> },
> {
> "protocol": “http”,
> "uri" : "http://www.example.com:8888/webofthings"
> }
> ]
Thanks for the suggestion. On further reflection, I would prefer:
{
“protocols” : [
“ws” : {
"uri" : "ws://www.example.com:8080/webofthings”
},
“http” : {
"uri" : "http://www.example.com:8888/webofthings"
}
]
}
This defines “protocols” as an ordered list of items, where each item asserts information about a particular protocol, e.g. the URI for accessing the server with that protocol, the content types and encodings, and so forth. This factoring allows for extension to server metadata unrelated to protocols. Having the protocols defined as a list makes them easier to process than my earlier suggestion. The code would look for the first compatible protocol, after having checked all of the assertions for that protocol.
What do you think?
p.s. I am hoping to implement this in time for TPAC with NodeJS and C++ based servers.
—
Dave Raggett <dsr@w3.org <mailto:dsr@w3.org>>