Computing.Net > Forums > Programming > Creating a proxy server

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Creating a proxy server

Reply to Message Icon

Name: dharanibabu
Date: August 6, 2003 at 23:41:35 Pacific
OS: win 2000
CPU/Ram: Pentium IV/ 256
Comment:

Hello all
I am trying to develope a proxy server for shoutcast server . Usually the DFP Plug In of winAmp enables connection to a shoutcast server and streams the voice data in mp3 format to it . The listeners connect to the Shoutcast server at its port and ip and listen to the broadcast coming out of the shoutcast server .
In order to reduce the latency in trnasmission I am trying to write a simple proxy server that will take the stream from the DSP plugin and redirect the stream to the shoutcast server but the problem is the DSP plugin is not connecting to the server . I am not able to figure out how to create appropriate server and with what type? should I create a Data gram or stream socket ? and how will it get the connection esablished from another application like DSP plugin ? please help me



Sponsored Link
Ads by Google

Response Number 1
Name: anonproxy
Date: August 9, 2003 at 10:27:41 Pacific
Reply:

I am not seeing what the problem is that requires a proxy.

We have WinAmp listening to a Shoutcast stream via a plugin. OK.

"take the stream from the DSP plugin and redirect the stream to the shoutcast server"

So, you want to mirror the stream back to the server? Reverse the client?


0

Response Number 2
Name: dharani babu
Date: August 10, 2003 at 20:55:05 Pacific
Reply:

Hello anonproxy
thanks for replying. The WinAmp works fine for getting the stream in from the SC server. Ok . But We want to use DSP Plug In to stream the mp3 to Shoutcast (SC) server OK? but after DSP streams the mp3 to SC server the clients get the mp3 stream from SC server after some 20-30 seconds of delay. If the DSP serves the purpose of a DJ then its ok to have a dealy of 20 sec but as we want to use the DSP and SC server to serve one way voice communication the 20 sec delay must be removed ot minimized . thats why I am trying to write a proxy that to which the DSP will connect to, instead of the normal SC server and the proxy has to take the stream in and redirect the stream to the SC server ( may be latency will be more now !)but the problem is the DSP is not connecting to the proxy server I have written . I wrote the proxy this way :
I am dharani babu from india. I am a VC++ programmer working at chennai in india for a US based company . I have some trouble with socket programming , as I came to know about your experience from ur postings I am confident that you will help me . Please help me sir . I am listing out my problem below :
sSock= socket (AF_INET, SOCK_STREAM, 0)
sockaddr.sin_family = AF_INET;
sockaddr.sin_port= htons(m_Port);
sockaddr.sin_addr.s_addr=inet_addr("192.168.0.101");
bind (sSock, (struct sockaddr*) &sockaddr, sizeof (sockaddr));
listen (sSock, 5);
HWND hwnd= GetSafeHwnd();
WSAAsyncSelect(sSock,hwnd,CONNECT_MESSAGE,FD_ACCEPT);
here the sSock is the server socket and its initialized to the port + ip and in the WSAAsyncSelect() i have used a CONNECT_MESSAGE to be fired in case of Connection attempts from clients .And In the handler function of the CONNECT_MESSAGE I call accept() to accept this new client but the DSP is not connecting and if I debug the server appln it is not even receiving any connection attempts .
So please advise me how i can solve this problem .I am wondering whether this is correct to get connection attempts from a EXE like DSP not written for our server !.
Please help me to solve this problem. Thanking you
regards Dharani babu
dharanibabus@hotmail.com india



0

Response Number 3
Name: anonproxy
Date: August 11, 2003 at 20:28:42 Pacific
Reply:

I read the introduction about the DSP plugin, so now I get what is going on here. Before I thought the plugin was only to recieve a stream - I see it is intended to submit a stream.

I also now understand why you need the proxy.

Firstly, is the delay unavoidable or a preset? I have not experimented, but have you considered just using a local DNAS at both ends to relay the stream? Most streaming clients and servers have buffer settings, which might be configurable enough to lessen the delay. If the DNAS can be set to simply accept another DNAS's stream and buffer it for a few hundred kb's at least, then you might just have your proxy.

I assume you have already experimented with the buffer settings on the clients and server.

I have a feeling that Shoutcast may not provide your solution, as it really is not geared towards live communication.

Look at this:
http://forums.winamp.com/showthread.php?s=03851b6523dee4bd658a88b407b90970&threadid=132678&highlight=live+voice

Did you examine some of the resources on the website?
http://forums.winamp.com/forumdisplay.php?forumid=9

I would look into a client that has robust buffering and bitrate settings to allow very low delay (built-in).

The only way I see you can solve the problem as in your post is to bind a homegrown application to the necessary ports, accept the data stream (while communicating with the client - you have to know what to say), and then passing the data on to the program. Then you would set the client to recieve from localhost and stream the data from the proxy to yourself (or over the network, if the proxy is not local).

What you do have to know? How the clients/servers communicate (specifically). This information I do not have. I recommend exploring other options just a little. Computer games have voice chat that is very near realtime, and I think there are open source alternatives.

Search sourceforge.net for "voice"
http://sourceforge.net/search/

I do not know the details of your project, but you may find something already done for you. A short look at sourceforge yeilds very promising returns. Good luck.



0

Response Number 4
Name: dharani babu
Date: August 11, 2003 at 22:19:36 Pacific
Reply:

Hello anan
Thanks for ur replies. Actually as u said I worked out with the but rate to reduce the latency . and after doing that only i reduced the latency upto 5-6 seconds ,and now I could get the DSP attempts to connect to my proxy But the DSP is waiting for some sort of authorization response from the server which i dont know . So i am looking at the log files of shoutcastserver when it communicates to DSp . I too feel its hard to peep into the code of a client and server . But i have to do it .pl give me ur mail id i could nt see it from board. Thanks dharanibabus@hotmail.com


0

Response Number 5
Name: dharani babu
Date: August 15, 2003 at 00:37:36 Pacific
Reply:

hi anan
i got it . I listened at a port and got connected from the DSp and dsp sent a password from its side . and i forwarded the password from dsp to the Sc server and it replied with some authentications strings . and i passed the strings coming from sc server back to dsp and dsp replied with some other strings related to genre, site address etc .and i played a song there and its getting streamed to the proxy ..waw .. finished over with i t.. thanks for ur replies.. bye


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

creation of Thread using ... concatenating linked list...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Creating a proxy server

Creating a Windows Server using c++ www.computing.net/answers/programming/creating-a-windows-server-using-c/8001.html

Create a Data warehouse in SQL Server 2K www.computing.net/answers/programming/create-a-data-warehouse-in-sql-server-2k/2725.html

Programming a proxy in C code www.computing.net/answers/programming/programming-a-proxy-in-c-code/6551.html