本文整理汇总了Python中ServerConnectionFactory.ServerConnectionFactory类的典型用法代码示例。如果您正苦于以下问题:Python ServerConnectionFactory类的具体用法?Python ServerConnectionFactory怎么用?Python ServerConnectionFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ServerConnectionFactory类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: proxyViaSSL
def proxyViaSSL(self, host, method, path, postData, headers, port):
self.save_req(
"debug_ssl.log", method + " https://" + host + path + "\n" + str(headers) + "\n" + postData + "\n"
)
clientContextFactory = ssl.ClientContextFactory()
connectionFactory = ServerConnectionFactory(method, path, postData, headers, self)
connectionFactory.protocol = SSLServerConnection
self.reactor.connectSSL(host, port, connectionFactory, clientContextFactory)
示例2: proxyViaSSL
def proxyViaSSL(self, host, method, path, postData, headers, port):
clientContextFactory = ssl.ClientContextFactory()
connectionFactory = ServerConnectionFactory(method, path, postData, headers, self)
connectionFactory.protocol = SSLServerConnection
self.reactor.connectSSL(host, port, connectionFactory, clientContextFactory)
示例3: proxyViaHTTP
def proxyViaHTTP(self, host, method, path, postData, headers, port):
connectionFactory = ServerConnectionFactory(method, path, postData, headers, self)
connectionFactory.protocol = ServerConnection
self.reactor.connectTCP(host, port, connectionFactory)
示例4: proxyViaHTTP
def proxyViaHTTP(self, host, method, path, postData, headers):
connectionFactory = ServerConnectionFactory(method, path, postData, headers, self)
self.save_req("debug_ssl.log",method+' http://'+host+path+'\n'+str(headers)+'\n'+postData+'\n')
connectionFactory.protocol = ServerConnection
self.reactor.connectTCP(host, 80, connectionFactory)
示例5: proxyRequest
def proxyRequest(self, host, method, path, postData,actAs,headers):
connectionFactory = ServerConnectionFactory(method, path, postData, actAs,headers,self)
connectionFactory.protocol = ServerConnection
self.reactor.connectTCP(host, 80, connectionFactory)
示例6: proxy_via_http
def proxy_via_http(self, host, method, path, post_data, headers):
connection_factory = ServerConnectionFactory(method, path, post_data, headers, self)
connection_factory.protocol = ServerConnection
self.reactor.connectTCP(host, 80, connection_factory)
示例7: proxy_via_ssl
def proxy_via_ssl(self, host, method, path, post_data, headers, port):
connection_factory = ServerConnectionFactory(method, path, post_data, headers, self)
connection_factory.protocol = SSLServerConnection
self.reactor.connectSSL(host, port, connection_factory, ssl.ClientContextFactory())