title: How to solve websocket ping timeout?
body: <p>While running the following piece of code (in theory it should send a value every minute)</p>
  
  <pre><code>from __future__ import print_function
  from twisted.internet.ssl import CertificateOptions
  options = CertificateOptions()
  from os import environ
  from twisted.internet.defer import inlineCallbacks
  from twisted.internet import reactor
  from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
  from autobahn import wamp
  from datetime import datetime, timedelta
  import xlwings as wb
  import time
  import xlwings as wb
  
  class Component(ApplicationSession):
  
  """
  An application component that publishes an event every second.
  """
  
  @inlineCallbacks
  def onJoin(self, details):
      print("session attached")
  
  
  while True:
      try:
          wb.Book(r'C:\Users\Administrator\Desktop\Datasets\test_feed.xlsx')
          e = wb.Range('A2').value
          b = wb.Range('C2').value
          c = wb.Range('E2').value
      except Exception:
          print("----Waiting for RTD server response----")
          time.sleep(1)          
      try:                
          epoch = datetime(now.year, now.month, now.day)
          result = epoch + timedelta(days=c)
          result = result.replace(microsecond=0, second=0)
          if result &gt; now:
              now = result
              print("Stock", e, "Time", now, "Price", b)
              self.publish(u'com.myapp.ma', b)
      except Exception:
          print("-----Waiting1 for RTD server response----")
          time.sleep(1)
  def onDisconnect(self):
          print("disconnected")
          reactor.stop()
  
  
  
  if __name__ == '__main__':
      runner = ApplicationRunner(
          environ.get("AUTOBAHN_DEMO_ROUTER", u"ws://127.0.0.1:8080/ws"),
          u"crossbardemo")
      runner.run(Component)
  </code></pre>
  
  <p>The following error is returned </p>
  
  <pre><code>2017-12-28T18:43:52+0100 [Router       1604] dropping connection to peer tcp4:127.0.0.1:61531 with abort=True: WebSocket ping timeout (peer did not respond with pong in time)
  2017-12-28T18:43:52+0100 [Router       1604] session "8526139172223346" left realm "crossbardemo"
  </code></pre>
  
  <p>What I've tried to solve this problem:</p>
  
  <p>I) </p>
  
  <blockquote>
  <pre><code>from twisted.internet.ssl import CertificateOptions
  options = CertificateOptions()
  if __name__ == '__main__':
      runner = ApplicationRunner(
          environ.get("AUTOBAHN_DEMO_ROUTER", u"ws://127.0.0.1:8080/ws"),
          u"crossbardemo", ssl=options)
      runner.run(Component)
  </code></pre>
  </blockquote>
  
  <p>II)</p>
  
  <blockquote>
  <pre><code>if __name__ == '__main__':
      runner = ApplicationRunner(
          environ.get("AUTOBAHN_DEMO_ROUTER", u"ws://127.0.0.1:8080/ws"),
          u"crossbardemo",
      )
      runner.run(Component, auto_reconnect=True)
  </code></pre>
  </blockquote>
  
  <p>III)</p>
  
  <blockquote>
    <p>Regedit</p>
  
  <pre><code>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS
  </code></pre>
    
    <p>1.0]</p>
  
  <pre><code>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS
  </code></pre>
    
    <p>1.0\Client]
        "DisabledByDefault"=dword:00000000
        "Enabled"=dword:00000001</p>
  </blockquote>
  
  <p>IV)</p>
  
  <blockquote>
    <p>install certifi module (pip install certifi) set SSL_CERT_FILE, like
    export SSL_CERT_FILE="$(python -m certifi)"</p>
  </blockquote>
  
  <p>With still the same error. I am running on Windows 10, with crossbar demo router, autobahn and twisted. </p>
  
  <p>Link to router configuration:</p>
  
  <blockquote>
    <p><a href="https://github.com/crossbario/autobahn-python/tree/master/examples/twisted/wamp/pubsub/basic/.crossbar" rel="nofollow noreferrer">https://github.com/crossbario/autobahn-python/tree/master/examples/twisted/wamp/pubsub/basic/.crossbar</a></p>
  </blockquote>
  
  <p>Also, the following example code is working properly:</p>
  
  <pre><code>counter = 100
          while True:
              print("publish: com.myapp.ma", counter)
              self.publish(u'com.myapp.ma', counter)
              counter += 100
              yield sleep(30)
  </code></pre>