-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Proxy protocol relative URLs #1469
Comments
You could use a custom Assethandler for this https://wails.io/docs/reference/options/#assetshandler- |
This looks like it will work, but when I test it I run into this error
Tracing this back I find it's from code found in |
Currently AssetsHandler are supposed to be called only for requests that target the Wails assets. Changing this behaviour would lead to some inconsistency between the platforms.
We already have som inconsistency there, but AssetsHandler won't be called currently on any platform for |
So in the Windows case, the current behavior ends up being the desired Given that Wails is designed to utilize web frameworks for its frontend I think it would be useful to have an option or mechanism to control or proxy all requests that come in over the |
Personally I would opt to internally return a 308-redirect for anything that comes in to |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Now that #2151 has been merged the 308 redirect should be possible. This issue got marked stale due to age. |
Unfortunately WebKit2GTK 2.36+ still has no support for http redirects. See also #2109 (comment) |
This can now be achieved using package main
import (
"github.com/wailsapp/wails/v2"
assetserver2 "github.com/wailsapp/wails/v2/pkg/assetserver"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
)
func main() {
// Create an instance of the app structure
app := NewApp()
// Create application with options
err := wails.Run(&options.App{
Title: "externalserver",
Width: 1024,
Height: 768,
AssetServer: &assetserver.Options{
Handler: assetserver2.NewProxyServer("http://127.0.0.1:54321"),
},
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
OnStartup: app.startup,
Bind: []interface{}{
app,
},
})
if err != nil {
println("Error:", err.Error())
}
}``` |
It would be good if this could be tested on a newer version of linux |
Closing for now. Please feel free to reopen if you still want this looked at 👍 |
Is your feature request related to a problem? Please describe.
I am creating an email client and rendering HTML emails using an iframe. When the HTML content uses a protocol relative URL (e.g.
//fonts.googleapis.com
) the application attempts to use thewails:
protocol and an error is returned.Describe the solution you'd like
Is there some way to proxy requests made to the application? So when the browser code makes the request to
wails://
the app will forward it on tohttp://
and then return the correct response?Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: