mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-26 10:33:15 +03:00
22 lines
510 B
Python
22 lines
510 B
Python
#!/usr/bin/env python3
|
|
|
|
from helper import run_rpc_pipes, run_rpc_socket
|
|
|
|
import socket
|
|
import sys
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if "--tcp" in sys.argv:
|
|
index = sys.argv.index("--tcp")
|
|
port = int(sys.argv[index + 1])
|
|
nonce = sys.argv[index + 2].encode()
|
|
|
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
sock.connect(("localhost", port))
|
|
sock.sendall(nonce + b"\n")
|
|
|
|
run_rpc_socket(sock)
|
|
else:
|
|
run_rpc_pipes(sys.stdout, sys.stdin)
|