Serve multiple client request from server using bridge [closed] - vnc

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
My client basically make RDP kind of connection to server (see VNC server)
So, there are multiple client making connection to the server. To lower bandwidth, I want a bridge between server and clients. Basically this bridge will connect to server at a port and serve multiple client request.
I hope made my problem clear. Can anyone suggest what todo?
I want one connection from bridge to server and bridge should serve multiple client connection

For VNC there is a VNC reflector (bridge). You might be able to extend that to support RDP. I don't know of an existing RDP solution that is equivalent.

You can use ssh port forwarding to encrypt and compress traffic between your server and clients. For example, if you server runs on host server port 1234 and and bridge runs on host bridge, you set the tunnel up from host bridge like this:
[user#bridge ~]$ ssh -C -N -n -L *:1234:server:1234 server
So that when a client connects to bridge:1234 the connection is forwarded to server:1234 encrypting and compressing the traffic.

Related

Port tunnelling from behind firewall to remote server via VNC'd laptop? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I have a command-line application on linux that uses a specific port to talk to a remote server. Unfortunately, at work, that port is blocked.
I am able to connect my laptop via VNC to the network, and the laptop is on a wifi connection that does have port access to the remote server. I am able to ssh to my laptop from the secure network when it is connected.
Is there a way of using ssh port tunnelling to work around this? Can I port tunnel to my laptop and have my laptop act as a middle-man between the firewalled network and the remote server?
Many thanks.
If I understood you correct you can call ssh from where you are to reach your laptop. Then you should be able to do something like this:
ssh -f -N -L <local port>:<remote server ip or hostname>:<remote server port> <laptop ip or hostname>
This will create start a tcp listening port on the host where ssh originates that forwards to your remote host and port via the machine you ssh to.
Excerpts from https://man.openbsd.org/ssh
-L [bind_address:]port:host:hostport
-L [bind_address:]port:remote_socket
-L local_socket:host:hostport
-L local_socket:remote_socket
Specifies that connections to the given TCP port or Unix socket on the local
(client) host are to be forwarded to the given host and port, or Unix
socket, on the remote side. This works by allocating a socket to listen to
either a TCP port on the local side, optionally bound to the specified
bind_address, or to a Unix socket. Whenever a connection is made to the
local port or socket, the connection is forwarded over the secure channel,
and a connection is made to either host port hostport, or the Unix socket
remote_socket, from the remote machine.
Port forwardings can also be specified in the configuration file. Only the
superuser can forward privileged ports. IPv6 addresses can be specified by
enclosing the address in square brackets.
By default, the local port is bound in accordance with the GatewayPorts
setting. However, an explicit bind_address may be used to bind the
connection to a specific address. The bind_address of “localhost” indicates
that the listening port be bound for local use only, while an empty address
or ‘*’ indicates that the port should be available from all interfaces.
-f
Requests ssh to go to background just before command execution. This is
useful if ssh is going to ask for passwords or passphrases, but the user
wants it in the background. This implies -n. The recommended way to start
X11 programs at a remote site is with something like ssh -f host xterm.
If the ExitOnForwardFailure configuration option is set to “yes”, then a
client started with -f will wait for all remote port forwards to be
successfully established before placing itself in the background.
-N
Do not execute a remote command. This is useful for just forwarding ports.

Virtual Serial Port on linux through TCP [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
With the Virtual Serial Ports Emulator I can
Create a virtual serial port connector
Choose a port e.g. COM35 for the connector
Create TCP-Server
Assign the previously created virtual serial port to the server
Then clients can establish a stream connection to the tcp server by knowing the ip address, tcp port and the name of the virtual serial port.
In the above example I created an MICRO_Test application (c++) that simply connects to virtual serial port. When I write data to this port it will be received by all clients.
You can see it in the log in the image above.
While this is on windows, is there a way to achieve some equivalent behaviour on linux machines?
To sum up:
Some binary code (as interface for e.g. webservices)
|
|
| [send/receive via virtual com port]
|
|
TCP Server & COM connector (multiple instances possible with different ports)
| | |
| | |
| | |
Client 1 Client 2 Client X
The clients read physical data from their real com ports and send the data through the tcp stream to the server.
For linux I read a lot about socat, tty and ser2net. However I cannot get a real clue how to achieve an architecture like above on linux? Can you help me out with some information?
In theory you could use Python with PySerial package. It can handle COM ports, RFC2217 (ser2net) and TCP raw connections (socat).
For example you would start socat on all clients with real hardware and connect to them via Python script.
This statement opens raw socket:
tcp_con = serial.serial_for_url('socket://<my_ip>:<my_port>')

Connection Timeout on aws when Telnet on Port 25 [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Thanks you for your time.
I have just set up a Postfix mail server which is running as MTA in one of my aws instances. I can successfully connect to the localhost through 'telnet localhost 25', and I can send emails to both external and internal email accounts when connected on localhost, however whenever I try to connect through 'telnet zwitch.it 25' or 'telnet mail.zwitch.it 25' I get a connection timeout.
I have set up all my records, including the MX record and the SPF record with the values "v=spf1 include:amazonses.com include:zwitch.it -all" and "spf2.0/pra include:amazonses.com include:zwitch.it ~all".
I really cannot find what is the problem here, if there is a firewall, or if the port is blocked, or maybe something is wrong with my postfix configuration... I would really appreciate if you could help me.
To set up my postfix mail server I followed the instructions at http://flurdy.com/docs/postfix/ where it mentions the installation of a simple postfix server.
I thank you in advance for the help.
EDIT:
Thanks to the answer below the problem was fixed. I only had to go on my aws security groups and add SMTP to the list!
It's one of three things:
1.) You need to edit your security group in AWS to allow port 25 from all external IP addresses.
2.) Your DNS entries for mail.zwitch.it do not point to the external IP address of the AWS instance.
3.) You don't have a static IP (elastic) address configured for the instance.

Node server listening on port 8080, EC2 only works on 8080, website doesn't work [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
My EC2 instance is up and running at ec2:8080 because my node server is listening on port 8080. But I want to connect my instance as a cname to my website under a domain (At namecheap). The cname only accepts ec2 not ec2:8080, so my code won't go up. This is probably an easy fix, any help? (my security group accepts all ports so its not that)
You need to point your domain's DNS settings to your public DNS or elastic IP provided by EC2. From there, you need to allow an exception in your security group granting HTTP traffic through to port 8080. Assuming the DNS changes propagate, you should be able to access your instance on node server running on port 8080 by:
http://your.public.dns.address:8080/
or
http://elastic.ip:8080
Hope that helps.

ports on computer and firewall and it's purpose - 101 question [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 13 years ago.
Improve this question
Ok, computers have ports for applications to transfer data from the outside world into a firewall and then into a computer.
Then how does firefox and internet explorer use the same port on the same computer?
And why can't we use port 80 to pass all traffic from all places into the computer.
So why do we need specific ports?
It's not the ports on local that are important generally. It's the remote ports.
So when you open a browser and go to a site, you are establishing a connection from a (somewhat) random port on your end, to port 80 on the server end. The server responds back to you on the same connection. Web servers use TCP/IP, so this is what is called and established connection. If you were to go look at netstat -an on the server you connected to during web traffic, that is exactly what you would see:
tcp 0 0 ::ffff:192.168.1.223:22 ::ffff:192.168.1.230:2369 ESTABLISHED
That line says that my local machine has established a connection to my remote machine on port 22. My local machine picked a random outgoing port of 2369 to make this connection.
In this case, this is an ssh connection to my webserver in the basement.
Ports that servers should use for a particular service are listed here, but if you are going to control both ends of the connection, there is nothing stopping you from running a webserver on port 8383 if you wanted to. Just don't expect anyone else to get to it without you telling them about it. (or it being found in a port scan).
If you were running a webserver on your computer, it would open port 80 and listen for connections. Only one service can be LISTENing per IP address, so you couldn't run two web servers at once. Same thing if you then connected to your local webserver. You'd open a random local port and connect to your local port 80 on the same IP.
The opening the random local port is what allows you to have multiple local connections to a known remote port like 80.
There are 65536 ports available so it's unlikely you will ever run out, but many have 'well known' usages and are therefore avoided for your end of the connection. Generally everything above 1023 is fair game though. ( All services which require any kind of priviledge run on ports below 1023 )
This is a TCP/IP connection. TCP/IP has internal language to ensure the reliable delivery of information and does a handshake at the open of every connection to ensure the data can be transmitted.
Another common type of connection would be UDP. UDP does not establish a connection and is therefore a bit faster and has lower latency, but the programs that use it must be able to loose information and still work. It's basically a send off the data and pray protocol. Many online games work this way.
Each connection has a source and destination port. This is what allows you to have multiple connections from your machine to (say) a web server running on port 80. Connections are uniquely identified by SourceIP:SourcePort and DestIP:DestPort.
So in your example, Firefox and IE will be using the same port on the remote web server (port 80), but will have a different ports on your machine to tell them apart.
Try running netstat in a command prompt to see current connections.
ports can be used for anything, but there are conventions of the protocols to expect on certain ports.
and you can use 80 for other functions, some people do that as a simple way of bypassing firewalls...
however, only 1 application can be listening on a port.
Some netstat output can show you what's going on:
C:\Temp> netstat -an
TCP 192.168.XXX.150:1493 74.125.45.100:80 ESTABLISHED
TCP 192.168.XXX.150:1504 69.59.196.213:80 ESTABLISHED
TCP 192.168.XXX.150:1507 74.125.91.138:80 ESTABLISHED
TCP 192.168.XXX.150:1510 65.55.11.162:80 ESTABLISHED
TCP 192.168.XXX.150:1518 69.59.196.211:80 ESTABLISHED
TCP 192.168.XXX.150:1519 69.59.196.216:80 ESTABLISHED
TCP 192.168.XXX.150:3711 64.208.186.96:80 CLOSE_WAIT
Note that the 192.168.XXX.150 address is my computer's address on my home network. The 4 digit numbers following the IP address are the local port my computer is using to communicate with port 80 on a bunch of different servers.

Resources