Bug or not? WebViewProxy() must be called in the same procedure to work
Posted: Wed Mar 11, 2026 12:41 pm
It took me a while to find out, why my application is not working with a proxy. I finally found, that WebViewProxy() must be called in the same procedure than the webview is created. Otherwise, it will not work.
If this is a bug => needs to be fixed
If this is a feature => needs to be in documentation to avoid confusion
Working:
Not working:
I tested this behavior with PB 6.21 on Windows (x86-32) and MacOS (arm64).
Test hint: Add
to your hosts file in order to validate if the proxy is used or not.
If this is a bug => needs to be fixed
If this is a feature => needs to be in documentation to avoid confusion
Working:
Code: Select all
OpenWindow(0, 100, 100, 700, 500, "Hello", #PB_Window_SystemMenu | #PB_Window_Invisible)
WebViewProxy("http://proxy.mycompany.com", 3128)
WebViewGadget(0, 0, 0, 700, 500)
SetGadgetText(0, "https://www.google.com")
; Show the window once the webview has been fully loaded
HideWindow(0, #False)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindowCode: Select all
Procedure setProxy()
WebViewProxy("http://proxy.mycompany.com", 3128)
EndProcedure
OpenWindow(0, 100, 100, 700, 500, "Hello", #PB_Window_SystemMenu | #PB_Window_Invisible)
WebViewGadget(0, 0, 0, 700, 500)
SetGadgetText(0, "https://www.google.com")
; Show the window once the webview has been fully loaded
HideWindow(0, #False)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindowTest hint: Add
Code: Select all
127.0.0.1 www.google.com