Starts the authorization server on localhost. The ephemeral port in use will
be printed to stdout.
Definition at line 386 of file oauth_server.py.
387 """
388 Starts the authorization server on localhost. The ephemeral port in use will
389 be printed to stdout.
390 """
391
392 s = http.server.HTTPServer(("127.0.0.1", 0), OAuthHandler)
393
394
395
396
397 class _TokenState:
398 retries = 0
399 min_delay = None
400 last_try = None
401
402 s.token_state = defaultdict(_TokenState)
403
404
405
406 port = s.socket.getsockname()[1]
408
409
410 stdout = sys.stdout.fileno()
411 sys.stdout.close()
412 os.close(stdout)
413
414 s.serve_forever()
415
416
void print(const void *obj)
References main(), and print().
Referenced by oauth_server.OAuthHandler._token_state(), and main().