Пример #1
0
 def __build_websockets_resource(self):
     url = f'ws://{server_config.bind_address}:{server_config.websocket_port}/websockets'
     logger.info(f'Starting websocket server at port '
                 f'{server_config.websocket_port} with bind address {server_config.bind_address}.')
     factory = WorkspaceServerFactory(url=url)
     factory.protocol = BroadcastServerProtocol
     return factory
def proto():
    factory = WorkspaceServerFactory('ws://127.0.0.1')
    proto = factory.buildProtocol(('127.0.0.1', 0))
    proto.maskServerFrames = False
    proto.logFrames = False
    proto.send_queue = []
    proto.state = BroadcastServerProtocol.STATE_CLOSING
    proto.transport = TransportMock()

    return proto
Пример #3
0
 def __build_websockets_resource(self):
     websocket_port = int(
         faraday.server.config.faraday_server.websocket_port)
     url = f'ws://{self.__bind_address}:{websocket_port}/websockets'
     # logger.info(u"Websocket listening at {url}".format(url=url))
     logger.info(
         f'Starting websocket server at port '
         f'{self.__websocket_port} with bind address {self.__bind_address}.'
     )
     factory = WorkspaceServerFactory(url=url)
     factory.protocol = BroadcastServerProtocol
     return factory
Пример #4
0
    def __build_websockets_resource(self):
        websocket_port = int(
            faraday.server.config.faraday_server.websocket_port)
        url = f'{self.__bind_address}:{websocket_port}/websockets'
        if self.__websocket_ssl_enabled:
            url = 'wss://' + url
        else:
            url = 'ws://' + url
        # logger.info(u"Websocket listening at {url}".format(url=url))
        logger.info(
            'Starting websocket server at port {0} with bind address {1}. '
            'SSL {2}'.format(self.__websocket_port, self.__bind_address,
                             self.__ssl_enabled))

        factory = WorkspaceServerFactory(url=url)
        factory.protocol = BroadcastServerProtocol
        return factory
Пример #5
0
def proto():
    factory = WorkspaceServerFactory('ws://127.0.0.1')
    proto = factory.buildProtocol(('127.0.0.1', 0))
    return proto