title: failing WebSocket opening handshake ('WebSocket connection denied: origin 'file://' not allowed')
body: <p>I'm facing this error when i'm trying to connect to a websocket server</p>
  <pre><code>dropping connection to peer tcp4:127.0.0.1:49528 with abort=False: WebSocket connection denied: origin 'file://' not allowed
  </code></pre>
  <p>while I'm running my python server on localhost and I have a .exe electron app trying to connect to the python server using websockets
  However the connection is done correctly if I'm running the electron app using npm start
  I need it to work also from the .exe
  My server code</p>
  <pre><code>class Server():
      def __init__(self, ip, port):
          log.startLogging(sys.stdout)
          self.factory = WebSocketServerFactory(&quot;ws://{}:{}&quot;.format(ip, port))
          self.factory.protocol = protocol.MainServerProtocol
  
          # there should only be one connection at a time
          self.factory.setProtocolOptions(maxConnections=1)
          self.factory.setProtocolOptions(allowedOrigins=&quot;*&quot;)
          self.ip = ip
          self.port = port
  
      def run(self):
          try_to_listen(True, reactor, self.port, self.factory)
          reactor.run()
  </code></pre>