By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,032 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,032 IT Pros & Developers. It's quick & easy.

Access internal network locations from Internet

P: n/a
I have been asked to come up with a way to make a instant message program
that will allow our outside customers by clicking on a name in a drop down
menu can IM who they want.

THe application I have works after telling my router to forward all
communications from Port 5000 to a local IP address that contains the
"Socket Server" program.

mobjClient = New TcpClient("zz.zzz.zz.zz", 5000)
mobjClient.GetStream()

DisplayText("Connected" & vbCrLf)

mobjClient.GetStream.BeginRead(marData, 0, 1024, AddressOf DoRead,
Nothing)
Send(ipadd & " online")

THe only problem is that all users would get this message that are running
the client........not just the individual being requested.

Is there a way in this code sample to tell it to divert to a local IP(or
machine name) running the client within this network?
Nov 20 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
Cor
Scorpion,
I dont think so, but you can look voor NAT (Network Adress Translator).

I hope it puts you a very little bit on the route.
Cor
Nov 20 '05 #2

P: n/a
Thanks Cor.......

I will try looking under vb.net and nat in google.

This topic does not have a lot of information that I can find. It has been
frustrating. It must be able to be done though because MSN Messenger does it
quite nicely.

"Cor" <no*@non.com> wrote in message
news:3f**********************@reader20.wxs.nl...
Scorpion,
I dont think so, but you can look voor NAT (Network Adress Translator).

I hope it puts you a very little bit on the route.
Cor

Nov 20 '05 #3

P: n/a
"Cor" <no*@non.com> wrote in news:3f6c51b8$0$4255$48b97d01
@reader20.wxs.nl:
Scorpion,
I dont think so, but you can look voor NAT (Network Adress Translator).

I hope it puts you a very little bit on the route.
Cor


NAT won't do you any good if the request is coming from the WAN side. NAT
can only redirect the data properly if the request originated from the
LAN side.

However, here are some suggestions:

-Each user has their own port. All requests coming into that port would
be redirected to a particular LAN user.

-Pass more data to the LAN side (i.e. Username). Have a proxy application
on the LAN server parse and forward the information to the proper client.

BTW, regarding the original posts, I find it funny that your router would
forward a packet from the WAN side with no particular matching NAT entry
to all clients... this is kind of dangerous when you think about it...

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #4

P: n/a
Thanks Cor.......

I will try looking under vb.net and nat in google.

This topic does not have a lot of information that I can find. It has been
frustrating. It must be able to be done though because MSN Messenger does it
quite nicely.

"Cor" <no*@non.com> wrote in message
news:3f**********************@reader20.wxs.nl...
Scorpion,
I dont think so, but you can look voor NAT (Network Adress Translator).

I hope it puts you a very little bit on the route.
Cor

Nov 20 '05 #5

P: n/a
"Cor" <no*@non.com> wrote in news:3f6c51b8$0$4255$48b97d01
@reader20.wxs.nl:
Scorpion,
I dont think so, but you can look voor NAT (Network Adress Translator).

I hope it puts you a very little bit on the route.
Cor


NAT won't do you any good if the request is coming from the WAN side. NAT
can only redirect the data properly if the request originated from the
LAN side.

However, here are some suggestions:

-Each user has their own port. All requests coming into that port would
be redirected to a particular LAN user.

-Pass more data to the LAN side (i.e. Username). Have a proxy application
on the LAN server parse and forward the information to the proper client.

BTW, regarding the original posts, I find it funny that your router would
forward a packet from the WAN side with no particular matching NAT entry
to all clients... this is kind of dangerous when you think about it...

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #6

P: n/a
"scorpion53061" <sc************@yahoo.com> wrote in news:#s2r4S5fDHA.3284
@tk2msftngp13.phx.gbl:
Lucas and all,

Thank you for response.

In the code attached can you tell me how I would:

"LAN server parse and forward the information to the proper client"

This is the server code that the traffic is coming to that is
sending/receiving messages.


Your server code sits on a server that has access to the WAN and LAN
right? Your server uses Port 5000? Port Map Port 5000 in your router to
the machine hosting server code - all incoming requests to port 5000 will
only be sent to the machine with the server.

When an IM user logs in, your server will need to track which users are
online, and associate their internal IP with their username (or some
other unique form of identification).

On your website, you have a list of all users logged in right? Thus, when
an external user submits your form with the appropriate user they want to
contact, your server would do a look up and match the username to the IM
user's internal IP. Once you have the internal IP, it would be very easy
to send the message directly to the client.

So basically your architecture would look like this:

WAN LAN
Web user <-> Web Page <-> || <-> Server <-> IM

|| Is your router/firewall.

See how the Server acts as a proxy, relaying requests between WAN and
LAN?

So in your code, you'll need to beef up server code so you can redirect
the message to a particular user behind the firewall.

BTW, which IM software are you using?

To sum it up, the key is for your server code to know the internal IP
address of the IM client, so that the message can be directed to a
particular IM user.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #7

P: n/a
"scorpion53061" <sc************@yahoo.com> wrote in news:#s2r4S5fDHA.3284
@tk2msftngp13.phx.gbl:
Lucas and all,

Thank you for response.

In the code attached can you tell me how I would:

"LAN server parse and forward the information to the proper client"

This is the server code that the traffic is coming to that is
sending/receiving messages.


Your server code sits on a server that has access to the WAN and LAN
right? Your server uses Port 5000? Port Map Port 5000 in your router to
the machine hosting server code - all incoming requests to port 5000 will
only be sent to the machine with the server.

When an IM user logs in, your server will need to track which users are
online, and associate their internal IP with their username (or some
other unique form of identification).

On your website, you have a list of all users logged in right? Thus, when
an external user submits your form with the appropriate user they want to
contact, your server would do a look up and match the username to the IM
user's internal IP. Once you have the internal IP, it would be very easy
to send the message directly to the client.

So basically your architecture would look like this:

WAN LAN
Web user <-> Web Page <-> || <-> Server <-> IM

|| Is your router/firewall.

See how the Server acts as a proxy, relaying requests between WAN and
LAN?

So in your code, you'll need to beef up server code so you can redirect
the message to a particular user behind the firewall.

BTW, which IM software are you using?

To sum it up, the key is for your server code to know the internal IP
address of the IM client, so that the message can be directed to a
particular IM user.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #8

P: n/a
Your server code sits on a server that has access to the WAN and LAN
right? Your server uses Port 5000? Port Map Port 5000 in your router to
the machine hosting server code - all incoming requests to port 5000 will
only be sent to the machine with the server.

That is exactly what I have currently.

When an IM user logs in, your server will need to track which users are
online, and associate their internal IP with their username (or some
other unique form of identification).
They currently log in to our customer software which validates through a SQL
Server table called LOGINS. They can then select n in a drop down menu
select say "Plumbing Pricing Questions". Then the client software opens and
establishes a connection to the socket server. From there is where I dont
know how to direct the request to teh local IP at that point.

On your website, you have a list of all users logged in right? Thus, when
an external user submits your form with the appropriate user they want to
contact, your server would do a look up and match the username to the IM
user's internal IP. Once you have the internal IP, it would be very easy
to send the message directly to the client.
Okay so lets say I create another SQL table with these 2 fields for those
the customers are requesting to message with their local IP address so it
would be:

DEPARTMENT
Plumbing Pricing Questions

LOCALIP
155.155.1.30

I somehow have to get the socket server to acknolwedge the incoming request
as being for "Plumbing Pricing Questions" and then direct the message to
that IP.

So in your code, you'll need to beef up server code so you can redirect
the message to a particular user behind the firewall.


Yes exactly...........this is where I am stuck.
Nov 20 '05 #9

P: n/a
"scorpion53061" <sc************@yahoo.com> wrote in
news:uQ**************@TK2MSFTNGP11.phx.gbl:
I somehow have to get the socket server to acknolwedge the incoming
request as being for "Plumbing Pricing Questions" and then direct the
message to that IP.


You might have to beef up your connect code. Upon connection, you make the
client to send a string/ID with which department they are handling. Save
this information somewhere, maybe as a variable in the client object?

I noticed you store a collection of clients in your code you posted
earlier. If you know which client connection is associated with which
department, you could loop through your collection of client objects, find
the proper client, and send the information to that one particular
client???

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #10

P: n/a
Do you or anyone else know a good book that specializes in vb.net and socket
programming? Of what I am trying to do here?

"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
"scorpion53061" <sc************@yahoo.com> wrote in
news:uQ**************@TK2MSFTNGP11.phx.gbl:
I somehow have to get the socket server to acknolwedge the incoming
request as being for "Plumbing Pricing Questions" and then direct the
message to that IP.


You might have to beef up your connect code. Upon connection, you make the
client to send a string/ID with which department they are handling. Save
this information somewhere, maybe as a variable in the client object?

I noticed you store a collection of clients in your code you posted
earlier. If you know which client connection is associated with which
department, you could loop through your collection of client objects, find
the proper client, and send the information to that one particular
client???

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 20 '05 #11

P: n/a
It is on the server end.

I am lost at trying to get a list of internal IP's online
and how to direct messages to them from customers.

I am not even sure how to transfer the variables involved
(custname, and user they are seeking) to transfer to the
server program and how to restrict the conversation to
strictly between those two.

If you can help with this I would be very greatful.
Email me off list if you are willing.
-----Original Message-----
"scorpion53061" <sc************@yahoo.com> wrote in
news:##**************@TK2MSFTNGP09.phx.gbl:
Do you or anyone else know a good book that specializes in vb.net and socket programming? Of what I am trying to do here?
Not really, but I'm sure Wrox Publishing has one.

Actually your applicationseems pretty straight forward. I still don't understand why you're havingtrouble distinguishing which socket connection belongs to which client : )

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.http://members.ebay.com/aboutme/coolspot18/
.

Nov 20 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.