[MPlayer-users] Re: Proxy authentication problem

Kristoffer Møllerhøj krisfm at diku.dk
Fri Nov 21 13:02:08 CET 2003


Thank you very much for the patch, Sam. 

Unfortunaly, it does'nt work in my case, I still get the same error. However, 
the string new_url now gets the right format: 
http_proxy://user:pass@eksternproxy.k-net.dk:5556/http://www.dr.dk/netradio/drjazz32.asx
, but maybe the proxy I'm using does'nt support this format?

 - Kristoffer.

>Sam Mason wrote:
>>I guess you would need to change libmpdemux/network.c quite a bit to
>>get it all working.

>Scratch that; it's a pretty trivial change. . .  Try the included
>patch (against 1.0pre2, but may work against other versions).

>My proxy doesn't need authentication, but it looks as though it's
>sending the right stuff out onto the network.

>Let me know how you get on,
>  Sam
>-------------- next part --------------
>--- MPlayer-1.0pre2/libmpdemux/network.c        2003-08-15 20:13:23.000000000 
>+0100
>+++ MPlayer-hacked/libmpdemux/network.c 2003-11-20 16:59:46.000000000 +0000
>@@ -403,12 +403,26 @@
> 

>                        mp_msg(MSGT_NETWORK,MSGL_V,"Using HTTP proxy: %s\n", 
>proxy_url->url );
>                        len = strlen( proxy_url->hostname ) + strlen( 
>url->url ) + 20;  // 20 = http_proxy:// + port
>+
>+                       if(proxy_url->username)

>+                       {
>+                               len += strlen( proxy_url->username ) + 2;
>+
>+                               if(proxy_url->password)
>+                                       len += strlen( proxy_url->password );
>+                       }
>+
>                        new_url = malloc( len+1 );
>                        if( new_url==NULL ) {
>                                mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory 
>allocation failed\n");
>                                return url_out;
>                        }
>-                       sprintf(new_url, "http_proxy://%s:%d/%s", 
>proxy_url->hostname, proxy_url->port, url->url );
>+
>+                       if(proxy_url->username)
>+                               sprintf(new_url, 
>"http_proxy://%s:%s@%s:%d/%s", proxy_url->username, proxy_url->password ? 
>proxy_url->password : "", proxy_url->hostname, proxy_url->port, url->url );

>+                       else
>+                               sprintf(new_url, "http_proxy://%s:%d/%s", 
>proxy_url->hostname, proxy_url->port, url->url );
>+
>                        tmp_url = url_new( new_url );
>                        if( tmp_url==NULL ) {
>                                return url_out;

 
 



More information about the MPlayer-users mailing list