def requestTransports(bridges, transport, vulnerable): for _ in range(len(bridges)): request = HTTPSBridgeRequest(addClientCountryCode=False) request.client = randomValidIPv4String() request.isValid(True) if transport is not None: request.transports.append(transport) request.generateFilters() obtained_bridges = dist.getBridges(request, 1) for bridge in obtained_bridges: if vulnerable: self.assertFalse(bridge.hasProbingResistantPT()) for t in bridge.transports: self.assertTrue(t.methodname != 'obfs4' and t.methodname != 'scramblesuit') else: self.assertTrue(bridge.hasProbingResistantPT())
def randomClientRequest(self): bridgeRequest = HTTPSBridgeRequest(addClientCountryCode=False) bridgeRequest.client = randomValidIPv4String() bridgeRequest.isValid(True) bridgeRequest.generateFilters() return bridgeRequest