Skip to content
This repository was archived by the owner on Aug 30, 2026. It is now read-only.
This repository was archived by the owner on Aug 30, 2026. It is now read-only.

proxy not working on adding to session at the time of request #91

Description

@White2001Offl

Hi,
So basically if Proxies are added at the time of creating Session it works
but on sending request Like Get or Post it doesn't work

Using Proxy while creating Request in Session

proxyURL, _ := url.Parse("http://127.0.0.1:8080")
session := grequests.NewSession(nil)

res , _ := session.Get("https://api.ipify.org?format=json",&grequests.RequestOptions{
        Proxies: map[string]*url.URL{
		"http": proxyURL,
		"https": proxyURL,
	},
})
fmt.Println(res.String())

This above request gives my own IP

Using Proxy while Creating Session

proxyURL, _ := url.Parse("http://127.0.0.1:8080")
session := grequests.NewSession(&grequests.RequestOptions{
	Proxies: map[string]*url.URL{
		"http": proxyURL,
		"https": proxyURL,
	},
})
res , _ := session.Get("https://api.ipify.org?format=json",nil)
fmt.Println(res.String())

This Above Request works

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions