title: Using client and server websockets in same python script
body: <p>I am new to Python - and work on Slackware Linux with Python 3.4.3. I prefer simple no-dependency solutions within one single python script.</p>
  
  <p>I am building a demonized server program (A) which I need to access through both a regular shell CLI and GUIs in my web browser: it serves various files, uses a corresponding database and updates a firefox tab through python's WEBBROWSER function. Currently, I access process (A) via the CLI or a threaded network socket. This all started to work in a localhost scenario with all processes running on one machine.</p>
  
  <p>Now, it turns out that the WebSocket protocol would render my setup dramatically simpler and cut short on traditional flow protocols using Apache and complex frameworks as middlemen.</p>
  
  <ul>
  <li><p>1st central question: How do I access daemon (A) with websockets from the CLI? I thought about firing up a non-daemon version of my server program, now called (B), and send a program call to its (A) counterpart via the WebSocket HTTP protocol. This would make process (B) a websocket CLIENT, and process (A) a websocket SERVER. Is such a communication at all possible today?</p></li>
  <li><p>2nd question: Which is the best suited template solution for this scenario - that works with python 3.4.3 ?!  I started to play with Pithikos' very sleek python-websocket-server template (see <a href="https://github.com/Pithikos/python-websocket-server" rel="nofollow noreferrer">https://github.com/Pithikos/python-websocket-server</a>) but I am unable to use it as CLIENT (initiating the network call) to call its SERVER equivalent (receiving the call while residing in a daemonized process).</p></li>
  </ul>