Skip to content
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

Please add support for a scenario when the devices to be configured sit behind on or more jump boxes #265

Open
cpiatnit opened this issue Oct 11, 2024 · 1 comment

Comments

@cpiatnit
Copy link

Here is my scenario

our laptops ◄----►Jumpbox1 ◄----►Jumpbox2 ◄----►Router ◄----►devices to be configured

as the provider uses https for this please consider scenarios like this.

@cpiatnit
Copy link
Author

After experimenting with this and reading a little about how it should work it seems that this could be handled using socks proxy
I do not know Golang to test this

You can set the following environment variables to configure the proxy:
HTTP_PROXY: Set this to the address of your HTTP proxy server.
HTTPS_PROXY: Set this to the address of your HTTPS proxy server.
NO_PROXY: Set this to a comma-separated list of hosts that should bypass the proxy.
Code

export HTTP_PROXY=http://your-proxy-server:port
export HTTPS_PROXY=http://your-proxy-server:port
export NO_PROXY=localhost,127.0.0.1

If you are writing custom Go code that interacts with Terraform providers, you can explicitly check for and use the proxy settings from the environment variables.
Go

package main

import (
"fmt"
"net/http"
"os"
)

func main() {
// ... other code

// Get proxy settings from environment variables
httpProxy := os.Getenv("HTTP_PROXY")
httpsProxy := os.Getenv("HTTPS_PROXY")

// Create an HTTP client with proxy settings
client := &http.Client{}
if httpProxy != "" {
    client.Transport = &http.Transport{
        Proxy: http.ProxyURL(httpProxy),
    }
}

// ... use the client to make requests

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant