delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback



Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi








Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (3)


Host redirect / BouncerFormat this article printer-friendly!Bookmark function is only available for registered users!
Redirect
Product:
Delphi all versions
Category:
Internet / Web
Skill Level:
Scoring:
Last Update:
05/17/2001
Search Keys:
delphi delphi3000 article borland vcl code-snippet bouncer redirect host bnc port-redirect port
Times Scored:
6
Visits:
2562
Uploader: andrew phil
Company:
Reference: N/A
 
Question/Problem/Abstract:
You need to build a program that can be run and when you connect to it bounces you using the programs host (computer which is running it) works for irc,gaming servers,web browsers
Answer:



Create a new form add a client socket and a server socket and have the server socket accept the connection start the client connection and have the client connection reroute to the server socket (Here is an example form i did below) add a server socket and have it open on port 6969 and have it active and have a client socket and have it not active and on port 6667... run the program open irc connect to 127.0.0.1 6969 and it should take you to irc.dal.net with the programs host (running computers ip) cheers , stalky


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ScktComp;

type
  TForm1 = class(TForm)
    ClientSocket1: TClientSocket;
    ServerSocket1: TServerSocket;
    procedure ServerSocket1Accept(Sender: TObject;
      Socket: TCustomWinSocket);
    procedure ServerSocket1ClientRead(Sender: TObject;
      Socket: TCustomWinSocket);
    procedure ClientSocket1Read(Sender: TObject; Socket: TCustomWinSocket);
    procedure ServerSocket1ClientDisconnect(Sender: TObject;
      Socket: TCustomWinSocket);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.ServerSocket1Accept(Sender: TObject;
  Socket: TCustomWinSocket);
begin
ClientSocket1.host := 'irc.dal.net';
  ClientSocket1.active := true;
end;

procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
  Socket: TCustomWinSocket);
begin
ClientSocket1.Socket.SendText(Socket.ReceiveText);
end;

procedure TForm1.ClientSocket1Read(Sender: TObject;
  Socket: TCustomWinSocket);
begin
ServerSocket1.Socket.Connections[0].SendText(Socket.ReceiveText);
end;

procedure TForm1.ServerSocket1ClientDisconnect(Sender: TObject;
  Socket: TCustomWinSocket);
begin
ClientSocket1.Active := False;
end;

end.





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
Very nice program
    Kent Jones (Sep 19 2001 4:09PM)

How would I set this up to run a WebBrowser?
Respond

RE: Very nice program
stalky is l33t (Sep 26 2001 11:53AM)

Yeah i coded another un buggy version if ya intrested in the source email darkhelmet@freeze.com

latter fellas
Respond

Great
    ThrawN (May 17 2001 8:59PM)

Hey thanks a lot for this its very usefull and what i have been looking for, for some time.

Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


   


  Community Ad of
Peganza
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)