Click here to Skip to main content
15,889,595 members
Articles / Programming Languages / C#
Article

Socket stream redirection using .NET remoting

Rate me:
Please Sign up or sign in to vote.
3.17/5 (5 votes)
4 May 2004 57.2K   1.6K   24   5
Redirecting socket stream over HTTP channel with .NET remoting.

Sample Image - TCP2HTTP.jpg

Introduction

Since this is my first uploaded project, I will be quite brief.

This simple program uses .NET remoting built in HTTP channel to establish a two-way communication channel between client and server endpoints which is adequate for firewalled and proxy environments.

Basically, at the server end, TCP2HTTPActivator registers TCP2HTTPServer which is a MarshalByRefObject class that exposes a few methods for sending and receiving socket data. When a client connects to the server, it requests a connection to a particular TCP port. Server object opens a connection to the local port and serves as a proxy between client and server sides.

At the client end, TCP2HTTPClient starts listening at a predetermined port which is used for redirecting the TCP socket data transfer over HTTP channel. When an application connects locally to a defined port, TCP2HTTPClient feeds the data to the server and backwards via sendTCPStream and receiveTCPStream methods.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Croatia Croatia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionHas anyone figured out how to get this to work? Pin
Max Bogon21-Jun-07 6:32
Max Bogon21-Jun-07 6:32 
QuestionHow to run the demo? Pin
Lang Deng12-Oct-05 14:25
Lang Deng12-Oct-05 14:25 
Generalseperation Pin
seer_tenedos224-Feb-05 15:11
seer_tenedos224-Feb-05 15:11 
What i want to do is runt he remoting server at home that conencts to the local tcp server on say port 6689. The remoting server would be on port 80.

The client would need to use ntlm authentication to a proxy server at work and then would map the local port 90 to the port 6689 on my server but all traffic must be over port 80. Is this what the sample above does? I could not seem to get the above sample to work in this manner. could you provide a example that is a little clearer?

Chris
GeneralRe: seperation Pin
Navise26-Feb-05 11:52
Navise26-Feb-05 11:52 
GeneralMore details Pin
Michael A. Barnhart18-May-04 0:15
Michael A. Barnhart18-May-04 0:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.