Giter VIP home page Giter VIP logo

canopus's People

Contributors

cbrake avatar maltej avatar ptone avatar zltl avatar zubairhamed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canopus's Issues

Decomposing URIs into Options

The steps to parse a request's options from a string |url| are as
follows. These steps either result in zero or more of the Uri-Host,
Uri-Port, Uri-Path, and Uri-Query Options being included in the
request or they fail.

  1. If the |url| string is not an absolute URI ([RFC3986]), then fail
    this algorithm.

  2. Resolve the |url| string using the process of reference
    resolution defined by [RFC3986]. At this stage, the URL is in
    ASCII encoding [RFC0020], even though the decoded components will
    be interpreted in UTF-8 [RFC3629] after steps 5, 8, and 9.

    NOTE: It doesn't matter what it is resolved relative to, since we
    already know it is an absolute URL at this point.

  3. If |url| does not have a component whose value, when
    converted to ASCII lowercase, is "coap" or "coaps", then fail
    this algorithm.

  4. If |url| has a component, then fail this algorithm.

  5. If the component of |url| does not represent the request's
    destination IP address as an IP-literal or IPv4address, include a
    Uri-Host Option and let that option's value be the value of the
    component of |url|, converted to ASCII lowercase, and then
    convert all percent-encodings ("%" followed by two hexadecimal
    digits) to the corresponding characters.

  NOTE: In the usual case where the request's destination IP
  address is derived from the host part, this ensures that a Uri-
  Host Option is only used for a <host> component of the form reg-
  name.
  1. If |url| has a component, then let |port| be that
    component's value interpreted as a decimal integer; otherwise,
    let |port| be the default port for the scheme.

  2. If |port| does not equal the request's destination UDP port,
    include a Uri-Port Option and let that option's value be |port|.

  3. If the value of the component of |url| is empty or
    consists of a single slash character (U+002F SOLIDUS "/"), then
    move to the next step.

    Otherwise, for each segment in the component, include a
    Uri-Path Option and let that option's value be the segment (not
    including the delimiting slash characters) after converting each
    percent-encoding ("%" followed by two hexadecimal digits) to the
    corresponding byte.

  4. If |url| has a component, then, for each argument in the
    component, include a Uri-Query Option and let that
    option's value be the argument (not including the question mark
    and the delimiting ampersand characters) after converting each
    percent-encoding to the corresponding byte.

Note that these rules completely resolve any percent-encoding.

ACK any duplicate copies of CON Messages

The recipient SHOULD acknowledge each duplicate copy of a Confirmable message using the same Acknowledgement or Reset message but SHOULD process any request or response in the message only once. This rule MAY be relaxed in case the Confirmable message transports a request that is idempotent or can be handled in an idempotent fashion.

Composing URIs from Options

  1. If the request is secured using DTLS, let |url| be the string
    "coaps://". Otherwise, let |url| be the string "coap://".
  2. If the request includes a Uri-Host Option, let |host| be that
    option's value, where any non-ASCII characters are replaced by
    their corresponding percent-encoding. If |host| is not a valid
    reg-name or IP-literal or IPv4address, fail the algorithm. If
    the request does not include a Uri-Host Option, let |host| be
    the IP-literal (making use of the conventions of [RFC5952]) or
    IPv4address representing the request's destination IP address.
  3. Append |host| to |url|.
  4. If the request includes a Uri-Port Option, let |port| be that
    option's value. Otherwise, let |port| be the request's
    destination UDP port.
  5. If |port| is not the default port for the scheme, then append a
    single U+003A COLON character (:) followed by the decimal
    representation of |port| to |url|.
  6. Let |resource name| be the empty string. For each Uri-Path
    Option in the request, append a single character U+002F SOLIDUS
    (/) followed by the option's value to |resource name|, after
    converting any character that is not either in the "unreserved"
    set, in the "sub-delims" set, a U+003A COLON (:) character, or a
    U+0040 COMMERCIAL AT (@) character to its percent-encoded form.
  7. If |resource name| is the empty string, set it to a single
    character U+002F SOLIDUS (/).
  8. For each Uri-Query Option in the request, append a single
    character U+003F QUESTION MARK (?) (first option) or U+0026
    AMPERSAND (&) (subsequent options) followed by the option's
    value to |resource name|, after converting any character that is
    not either in the "unreserved" set, in the "sub-delims" set
    (except U+0026 AMPERSAND (&)), a U+003A COLON (:), a U+0040
    COMMERCIAL AT (@), a U+002F SOLIDUS (/), or a U+003F QUESTION
    MARK (?) character to its percent-encoded form.
  9. Append |resource name| to |url|.
  10. Return |url|.

Apply MAX_TRANSMIT_SPAN to CON Messages

MAX_TRANSMIT_SPAN is the maximum time from the first transmission of a Confirmable message to its last retransmission.
ACK_TIMEOUT * ((2 ** MAX_RETRANSMIT) - 1) * ACK_RANDOM_FACTOR

HTTP-CoAP proxy

  • Expose HTTP Proxy Endpoint at root /
  • if Request starts with coap/coaps
  • if not enabled/proxy not allowed, return 5.01
  • if timeout, return 5.04
  • if response not understood, return 5.02
  • cross check allowed coap accept headers allowed - returns 406 not acceptable
  • Methods
    • OPTIONS
      return 5.01
    • TRACEw
      return 5.01
    • GET
      if Success return 2.00
      response payload == CoAP Representation resource, Content-Type and Content-Encoding header must be set
      • Include to CoAP Request
        • Accept, Conditional GET
        • If Accept, validate Accept is valid, else return 4.06
    • HEAD
      • Like GET but no message body response
    • POST
      • If the action performed by the POST method does not result in a resource that can be identified by a URI, a 200 (OK) or 204 (No Content) response MUST be returned to the client.
      • If a resource has been created on the origin server, a 201 (Created) response MUST be returned.
      • If CoAP responds with Location-, return to HTTP the Location- Headers
    • PUT, DELETE
    • CONNECT
      return 5.01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.