Results 1 to 7 of 7

Thread: [RESOLVED] Redirecting connections

  1. #1

    Thread Starter
    Addicted Member DramaQueen's Avatar
    Join Date
    Mar 2010
    Posts
    187

    Resolved [RESOLVED] Redirecting connections

    Howdy..

    Scenario:
    Client tries to connect to server "1.2.3.4:8080" via sockets, but I want it to connect to "localhost:8080" instead. My question is - is there a way to configure a firewall / router to redirect connections directed to certain host, to localhost? If not, are there other ways simpler than writing a system-wide sockets hook?

    TIA

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Redirecting connections

    The simplest way (which I think will work for this) is to edit your Hosts file, which should be stored in %system32%\drivers\etc

    By default it contains examples and explanations of how to add that kind of thing to it.

  3. #3
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Redirecting connections

    The hosts file is for resolving host names to IPs, not the other way around so you cannot use it to redirect traffic sent to an IP address to a host name I'm afraid.

    What type of router/firewall are you using?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  4. #4

    Thread Starter
    Addicted Member DramaQueen's Avatar
    Join Date
    Mar 2010
    Posts
    187

    Re: Redirecting connections

    Yeah, the hosts file won't do the trick this time, generally good idea though. I'm just using windows firewall and a motorola router.

  5. #5

    Thread Starter
    Addicted Member DramaQueen's Avatar
    Join Date
    Mar 2010
    Posts
    187

    Re: Redirecting connections

    No ideas anyone? If it's of any help, the client thats connection I want to intercept is written in Java.

  6. #6

    Thread Starter
    Addicted Member DramaQueen's Avatar
    Join Date
    Mar 2010
    Posts
    187

    Re: [RESOLVED] Redirecting connections

    Well, I got it sorted out. Eventually I just had to modify the original client a little bit to make it connect to localhost instead.

  7. #7
    Addicted Member
    Join Date
    Apr 2003
    Posts
    148

    Re: [RESOLVED] Redirecting connections

    or maybe write a inject dll into which program u want to change host.
    using hook connect.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width