Hello friends!
I need to use an ip address to open the page, but the web server requires entering the site name. If you change the ip in the header to a name, the page will open successfully.
Is it possible to change the Host value in the header in webgadget?
I need a windows only solution.
Change Header in WebGadget
Re: Change Header in WebGadget
Do you need to open one page, or several pages on your site?
If it is for just one page I believe I have a solution.
If it is for just one page I believe I have a solution.
Re: Change Header in WebGadget
If you are Windows user you can use CMD
OR
If I remember there is JAVA script to do the job too
which you can run it directly from PB WebGadget
Code: Select all
> nbtstat %your IP%
Code: Select all
>nslookup %your IP%
which you can run it directly from PB WebGadget
Egypt my love
Re: Change Header in WebGadget
yes, only one pagefluent wrote:Do you need to open one page, or several pages on your site?
If it is for just one page I believe I have a solution.
Re: Change Header in WebGadget
I was unable to find solutions in javascript. But I saw what miracles you demonstrated using winapi.RASHAD wrote: If I remember there is JAVA script to do the job too
which you can run it directly from PB WebGadget
This is my code opening page from ip adress but not change host in heder. Maby you help me IWebBrowser2 Navigate syntax
Code: Select all
myBrowser.IWebBrowser2 = GetWindowLong_(GadgetID(WebView_0), #GWL_USERDATA)
header.s="Host: phone/r/n"
myBrowser\Navigate("http://192.168.1.1",#Null,#Null,#Null,@*header)
Re: Change Header in WebGadget
OK, Headers is a Variant parameter.
Do it like this:
(If you get Error 400 on Bing, that means the code is working!)
Do it like this:
(If you get Error 400 on Bing, that means the code is working!)
Code: Select all
OpenWindow(0, 432, 42, 800, 500, "Window_0", #PB_Window_SystemMenu)
WebGadget(0, 10, 10, 780, 450, "")
Web.IWebBrowser2 = GetWindowLongPtr_(GadgetID(0), #GWL_USERDATA)
Web\put_Silent(#True)
url$ = "https://www.bing.com/"
header$ = "Host:AAA" + #CRLF$
var.VARIANT
var\vt = #VT_BSTR
var\bstrVal = @header$
Web\Navigate(url$, 0,0,0, var)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Re: Change Header in WebGadget
Thanks! Its work!fluent wrote:OK, Headers is a Variant parameter.