Starts the authorization server on localhost. The ephemeral port in use will
be printed to stdout.
Definition at line 367 of file oauth_server.py.
368 """
369 Starts the authorization server on localhost. The ephemeral port in use will
370 be printed to stdout.
371 """
372
373 s = http.server.HTTPServer(("127.0.0.1", 0), OAuthHandler)
374
375
376
377
378 class _TokenState:
379 retries = 0
380 min_delay = None
381 last_try = None
382
383 s.token_state = defaultdict(_TokenState)
384
385
386
387 port = s.socket.getsockname()[1]
389
390
391 stdout = sys.stdout.fileno()
392 sys.stdout.close()
393 os.close(stdout)
394
395 s.serve_forever()
396
397
void print(const void *obj)
References main(), and print().
Referenced by oauth_server.OAuthHandler._token_state(), and main().