Comments (2)
Hello @Viktor-Vasilev ,
You have two options here (same as with net/http
) use a handler for a specific path or use a proxy server which will transfer all incoming requests to the target url.
Check https://github.com/kataras/iris/blob/master/core/host/proxy.go#L31,
you can use it as
// [...]
import "github.com/kataras/iris/core/host"
// [...]
// proxySrv := iris.New()
u, err := url.Parse("https://localhost:4444")
if err != nil {
t.Fatalf("%v while parsing url", err)
}
p := host.ProxyHandler(u)
// [...]
app.Get("/some/api", iris.FromStd(p))
// or start a new whole proxy server:
go host.NewProxy("myproxy:3232", u).ListenAndServe()
These derives from net/http
the only thing that Iris does, is some improvements on the url parsing and able to skip tls
if your target is a loopback address (when testing).
For more options and advanced features you can take a look at other libraries, anything compatible with net/http
is OK to being used inside iris
too, therefore you don't have limitations.
from iris.
Thank you!
from iris.
Related Issues (20)
- [HELP] How to dynamically start http services on multiple ports? HOT 1
- [HELP] How to proactively send websocket messages to the client in an MVC structure?
- [HELP] Multiple event when using native message
- Iris gRPC wrapper breaking HOT 1
- getBuiltinFuncs problem
- [BUG] template part Unable to load HOT 1
- [BUG] I used goroutine to affect the later HTTP before the service startup HOT 2
- [BUG] validation of binding is not effective
- [QUESTION] The session configuration provided by the iris framework is limited
- [FEATURE REQUEST] Get the data in the session through the session id
- [BUG] ctx.RemoveCookie need more special attribute(`domain` and `path`) value to remove cookies HOT 3
- slog is not in GOROOT HOT 1
- how to integrate SSE with mvc.
- [BUG] session recreation results in no session at all HOT 1
- How to integerate iris.FromStd with mvc.Application HOT 2
- [FEATURE REQUEST] SPA SubPath are not supported HOT 1
- ctx.Next() error
- Getting 403 Error on PUT | PATH | DELETE Request HOT 1
- [Question] Can not bind parameter of struct using ReadBody
- invalid version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iris.