<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>27915</bug_id>
          
          <creation_ts>2015-01-28 07:00:23 +0000</creation_ts>
          <short_desc>Clients of WebSockets are not NTP synced (and there is no NTP-alike spec)</short_desc>
          <delta_ts>2015-10-01 21:26:36 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebSocket API (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>cmartensms</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>d</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>117530</commentid>
    <comment_count>0</comment_count>
    <who name="">cmartensms</who>
    <bug_when>2015-01-28 07:00:23 +0000</bug_when>
    <thetext>All major browsers (Chromium, Opera, Firefox, IE) have problems when being used in realtime networking applications.

Date.now() inside the browser is not synced with NTP, therefore clients can gain access to systems when they reset their clock to a previous date when WebRTC or WebSockets are used peer-to-peer.

I think we need desperately a WebSocket extensions spec that can be implemented in order to sync the network connection with a heartbeat and tick(-ack).

From a developer perspective, I can&apos;t believe nobody had the issue before. There are also no libraries available, which seems surreal as there are thousands of users of Socket.IO and other WebSocket libraries where all the libraries depend on a synced clock as they are using Date.now() etc.


My questions so far are:
- Why are browsers not synced with NTP in the background?
- Why is there no WebSocket extension spec that implements an NTP-like behaviour?
- How to overwrite the behaviour of Date.now(), it is pretty much bad approach to do so?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117606</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-01-29 23:05:52 +0000</bug_when>
    <thetext>Browsers rely on the system clock. Most (all?) systems I deal with these days have system clocks driven by NTP. What systems don&apos;t?

You can presumably layer NTP-like behaviour on top of a combination of WebSocket and WebRTC. This doesn&apos;t seem like something that need be baked into the protocol (just like it&apos;s not baked into TCP or UDP).

You can replace Date.now by saying:

   Date.now = function () { ... }

Indeed you can replace Date entirely if you like.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123425</commentid>
    <comment_count>2</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2015-10-01 21:26:36 +0000</bug_when>
    <thetext>Markings as resolved per comment 1&apos;s

&gt; Browsers rely on the system clock. Most (all?) systems I deal with these days have system clocks driven by NTP. What systems don&apos;t?

and

&gt; You can replace Date.now by saying:

Let us know if you disagree and we can reopen.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>