B4J Question [ Jserver ] Can i get parameters from page using websocket handle ?

Waldemar Lima

Well-Known Member
Licensed User
Longtime User
hello everyone ! Can i get parameters from page using websocket handle ?

i am using command but returns " empty " :
B4X:
Log("param = "&ws.UpgradeRequest.GetParameter("token"))

link used :
B4X:
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?
 

Waldemar Lima

Well-Known Member
Licensed User
Longtime User
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.

would you have an example of how I would make the handler filter interact with the ws server?
 
Upvote 0
Top