-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proxy support? #21
Comments
Hi. |
You can use the httpbeast library, which provides easy-to-use HTTP client capabilities, including proxy support. You can install it using Nim's package manager Nimble if you haven't already:
Here's a basic example of how you can make an HTTP request through a proxy in a Nim application: import httpbeast, asyncdispatch
proc main() {.async.} =
# Define the proxy settings
let proxy = Proxy(kind: HttpProxy, host: "your_proxy_host", port: 8080, username: "your_username", password: "your_password")
# Create an HTTP client with the proxy settings
let client = newAsyncHttpClient(proxy: proxy)
# Define the URL you want to fetch through the proxy
let url = "https://example.com"
try:
# Make an HTTP GET request
let response = await client.get(url)
# Check the response status
if response.status == 200:
echo("Success: ", response.body)
else:
echo("Failed with status code: ", response.status)
except HttpException as e:
echo("HTTP request error: ", e.msg)
asyncCheck main() In this example:
Make sure to replace " Well, depending on your specific use case, you may need to customize the code further, handle exceptions, and add error handling. |
I'd like to request proxy support if possible. I have to get off of the company VPN in order to use this app successfully. Love your app <3.
The text was updated successfully, but these errors were encountered: