Starts the authorization server on localhost. The ephemeral port in use will
be printed to stdout.
Definition at line 406 of file oauth_server.py.
407 """
408 Starts the authorization server on localhost. The ephemeral port in use will
409 be printed to stdout.
410 """
411
412 s = http.server.HTTPServer(("127.0.0.1", 0), OAuthHandler)
413
414
415
416
417 class _TokenState:
418 retries = 0
419 min_delay = None
420 last_try = None
421
422 s.token_state = defaultdict(_TokenState)
423
424
425
426 port = s.socket.getsockname()[1]
428
429
430 stdout = sys.stdout.fileno()
431 sys.stdout.close()
432 os.close(stdout)
433
434 s.serve_forever()
435
436
void print(const void *obj)
References main(), and print().
Referenced by oauth_server.OAuthHandler._token_state(), and main().