mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-18 07:22:12 +03:00
22 lines
507 B
Python
22 lines
507 B
Python
#!/usr/bin/env python3
|
|
|
|
from rpc 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)
|