Compilation of script py://connect.py failed.
python script:
import socket
def establish_tcp_connection(host, port):
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((host, port))
print(f"TCP connection established with {host}:{port}")
sock.close()
except socket.error as e:
print(f"Error: {e}")
# Example usage
var host= flow.getVariable('targethost');
var port= flow.getVariable('targetport');
establish_tcp_connection(host, port)
the host and port values can be taken from the request. I am getting a compilation error while trying to deploy the proxy with the above script.
Will this work or is there a different way i can approach this.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |