Waldemar Lima Well-Known Member Licensed User Longtime User Feb 4, 2022 #1 hello everyone ! Can i get parameters from page using websocket handle ? i am using command but returns " empty " : B4X: Copy Log("param = "&ws.UpgradeRequest.GetParameter("token")) link used : Code: Copy http://127.0.0.1:8092/app.html?token=xLNew7wBBtFsotg3InCUIxQ3aBEMlw one way to get the parameter is to make the user go through a Handler and redirect to the websocket connection page ... is there any way to get the parameter from the page without having to go through a handler first?
hello everyone ! Can i get parameters from page using websocket handle ? i am using command but returns " empty " : B4X: Copy Log("param = "&ws.UpgradeRequest.GetParameter("token")) link used : Code: Copy http://127.0.0.1:8092/app.html?token=xLNew7wBBtFsotg3InCUIxQ3aBEMlw one way to get the parameter is to make the user go through a Handler and redirect to the websocket connection page ... is there any way to get the parameter from the page without having to go through a handler first?
Erel B4X founder Staff member Licensed User Longtime User Feb 6, 2022 #2 The link you posted is not the "upgrade request". It makes a GET request to a html page and then the upgrade request is made with JavaScript. You should add a Filter handler for app.html. Upvote 0
The link you posted is not the "upgrade request". It makes a GET request to a html page and then the upgrade request is made with JavaScript. You should add a Filter handler for app.html.
Waldemar Lima Well-Known Member Licensed User Longtime User Feb 6, 2022 #3 Erel said: The link you posted is not the "upgrade request". It makes a GET request to a html page and then the upgrade request is made with JavaScript. You should add a Filter handler for app.html. Click to expand... would you have an example of how I would make the handler filter interact with the ws server? Upvote 0
Erel said: The link you posted is not the "upgrade request". It makes a GET request to a html page and then the upgrade request is made with JavaScript. You should add a Filter handler for app.html. Click to expand... would you have an example of how I would make the handler filter interact with the ws server?
Erel B4X founder Staff member Licensed User Longtime User Feb 7, 2022 #4 Store the values in the user session. Upvote 0