https://github.com/benehiko/oryproxy
A library to setup a proxy between your go service and an Ory Network Project
https://github.com/benehiko/oryproxy
Last synced: 2 months ago
JSON representation
A library to setup a proxy between your go service and an Ory Network Project
- Host: GitHub
- URL: https://github.com/benehiko/oryproxy
- Owner: Benehiko
- License: apache-2.0
- Created: 2023-12-12T14:17:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-12T15:46:47.000Z (almost 2 years ago)
- Last Synced: 2025-04-07T08:34:18.519Z (6 months ago)
- Language: Go
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ory Proxy
A simple library that exposes a go `http.Handler` to proxy requests to and from
an Ory Network project. The library includes sane defaults and provides
an easy way to configure the proxy to fit your project needs.The Ory CLI already provides proxy/tunnel capabilities, however,
when deploying a Go service to serverless infrastructure you
need to add a custom domain to your Ory Network.This doesn't always work, since you might have test services or staging services
that do not need a custom domain setup. This library helps with that.## Get Started
```sh
go get -u github.com/Benehiko/oryproxy
```Setup the proxy as a standalone service
```go
package mainimport "github.com/Benehiko/oryproxy"
func main() {
config := oryproxy.NewDefaultConfig("https://project-slug.projects.oryapis.com")
proxy := oryproxy.NewOryProxy(config)
proxy.ListenAndServe(ctx, 3000)
}
```Or integrate into your existing service
```go
package mainimport (
"github.com/Benehiko/oryproxy"
"github.com/gorilla/mux"
)func main() {
config := oryproxy.NewDefaultConfig("https://project-slug.projects.oryapis.com")
proxy := oryproxy.NewOryProxy(config)router := mux.NewRouter()
// /.ory is the default path prefix for the proxy.
// this can be changed.
router.PathPrefix("/.ory").Handler(proxy.OryProxy())
}
```## Limitations
Although this library proxies requests to and from Ory, it is still subject
to rate-limiting on the Ory Network project subscription you have. Free-tier
projects can easily hit rate-limits and you should consider upgrading as soon
as you have real traffic on your service.## Notice
This library is not officially supported by Ory. Please do not open support
tickets on the Ory repositories regarding this project nor ask for support
on their Slack channel.