I have implemented a thread with a server socket in my device that reveal the incoming connection from (for example) a browser. I have found correctly the IP
address of the client, but I'm not able to find the url params. Can you please give me help?
Please consider this string for example: 192.168.1.110:80/?id=123
or 192.168.1.110/page?id=123
Here there is my class.
public class ServerThread implements Runnable {
public void run(){
try{
if ( SERVERIP != null){
serverStatus.setText("Listening on IP: " + ip_address_conversion + ":" + SERVERPORT);
serverSocket = new ServerSocket(SERVERPORT);
while (true){
Socket client = serverSocket.accept();
handler.post(new Runnable(){
@Override
public void run(){
serverStatus.setText("Connected");
}
});
InetAddress ip_client = client.getInetAddress();
Log.i("Log", "ip client "+ip_client);
//Here i have to find the url params
}
}
} catch (Exception e){
serverStatus.setText("Error");
}
}
}
Thanks