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