URI Parser

I need split some uri ex. to host, port, path Is there any package/function for do that ?

Take a look at the strtok() function

How are you receiving the URL in your program and what data type is it ?

its static char *_uri; for now I use something like this:

    String url      = _uri;
    int p1    = url.indexOf(":");
    String prot = url.substring(0,p1); 

but I don't believe in my code, it miss no port in uri, etc.

Why are you converting _uri to a String ? You could use the strtok() function on _uri to break it into its component parts

Hopefully this wil help:

void setup() {
  // put your setup code here, to run once:
  while (!Serial) ;
  char uri[] = "";
  char * pch;
  pch = strtok (uri, "/:_");
  while (pch != NULL)
    Serial.println (pch);
    pch = strtok (NULL, "/:_");

void loop() {

The output is:

16:12:59.999 -> http 16:12:59.999 -> 16:12:59.999 -> 9233 16:12:59.999 -> path 16:12:59.999 -> file.mp3

Be aware that using strtok() is destructive and that the original string, uri in this case, will be changed by the process. Print it at the end of setup() above to see what I mean. You might, therefore, want to work on a copy if you need to leave the original untouched.