You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'resp' is a stream-writer and has a function 'get_extra_info' which gives a dict with only one element: 'peername'. This hold a tuple with addr and port.
Example:
@app.route("/")defindex(req, resp):
clinet_ip, client_port=resp.get_extra_info('peername')
yieldfrompicoweb.start_response(resp)
yieldfromresp.awrite("Your IP address is ")
yieldfromresp.awrite(clinet_ip)
yieldfromresp.awrite(" on port ")
yieldfromresp.awrite(str(client_port))
Is there a way to log the client ip and/or port on the request?
The text was updated successfully, but these errors were encountered: