© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
10 replies
Auxl

❔ HttpListener for single use request

Haven't found any useful answers online.

I've got a console app where I want to open the user's main browser to an oauth login page. The callback leads back to the program at localhost. So I believe I need to run an httplistener to capture this callback. However this is the only use I would have in the program's lifetime for the httplistener. The rest of the authorization flow can be maintained through an httpclient.

Is it viable or acceptable to spin up and dispose an httplistener like this? Maybe there's a better option for temporary listeners with asp? Or am I overthinking this and there's another solution?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

HttpListener
C#CC# / help
3y ago
✅ HttpListener not starting
C#CC# / help
3y ago
❔ HttpListener Access Denied
C#CC# / help
3y ago
HttpListener listen on ipv6
C#CC# / help
4y ago