flat-waitress-75076
12/10/2024, 3:48 PMbrief-egg-61061
12/10/2024, 3:48 PMbrief-egg-61061
12/10/2024, 3:48 PMgo package main import ( "context" "fmt" "net/http" client "<http://github.com/ory/hydra-client-go|github.com/ory/hydra-client-go>" ) func main() { tlsTermClient := new(http.Client) rt := WithHeader(tlsTermClient.Transport) rt.Set("X-Forwarded-Proto", "https") tlsTermClient.Transport = rt config := client.NewConfiguration() config.Servers = []client.ServerConfiguration{ { URL: "<https://hydra.localhost:4444>", // Public API URL }, } config.HTTPClient = tlsTermClient c := client.NewAPIClient(config) fmt.Println(c.PublicApi.RevokeOAuth2Token(context.Background()).Token("some_token").Execute()) // ... } // WithHeader implementation...
This code snippet is from the [Ory Hydra Go SDK documentation](https://www.ory.sh/docs/hydra/self-hosted/go#fake-tls-termination). 4. Check your Nginx configuration: If you're using Nginx as a reverse proxy, ensure that it's properly configured to handle HTTPS traffic and forward it to Hydra. You can find an example Nginx configuration in the [Ory Hydra deployment documentation](https://www.ory.sh/docs/hydra/self-hosted/deploy-hydra-example#install-and-configure-nginx). Remember to always use HTTPS in production environments to ensure secure communication between clients and your Hydra server.