Communicate through a server
- Kwai chang caine
- Always Here
- Posts: 5353
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Communicate through a server
Hello at all
I search a very simple way (like usually ) for master communicate with another slave pc, accross my serveur 1&1
In fact, using the style of method of TEAMVIEWER
Like that, no need to manage the firewall and the box ports of slave
Exe master and Exe Slave in port 80, it's open bar
So actually, with my very little knowledge of HTTP and already thanks to master INFRATEC i can send commands to my server, writing a txt file on it in php with the command inside, and read with the esclave the command to execute.
But the question, in the bidet that serves as my brain it's perhaps a memory way is possible in the JS/PHP server for not need to writing each order in file, for after immediately delete it
If you know one simple method
Have a good day
I search a very simple way (like usually ) for master communicate with another slave pc, accross my serveur 1&1
In fact, using the style of method of TEAMVIEWER
Like that, no need to manage the firewall and the box ports of slave
Exe master and Exe Slave in port 80, it's open bar
So actually, with my very little knowledge of HTTP and already thanks to master INFRATEC i can send commands to my server, writing a txt file on it in php with the command inside, and read with the esclave the command to execute.
But the question, in the bidet that serves as my brain it's perhaps a memory way is possible in the JS/PHP server for not need to writing each order in file, for after immediately delete it
If you know one simple method
Have a good day
The happiness is a road...
Not a destination
Not a destination
Re: Communicate through a server
The first would be to immediately block port 80 again. This port is often attacked.
Furthermore you don't have to use HTTP and PHP to exchange data. HTTP also only uses TCP/IP, so you can create your own protocol and write it with PB via server-client solution. It is best to use a port that is not already defined with standards: Port 6000-7000. you can forward this port in your router to your server program.
Furthermore you don't have to use HTTP and PHP to exchange data. HTTP also only uses TCP/IP, so you can create your own protocol and write it with PB via server-client solution. It is best to use a port that is not already defined with standards: Port 6000-7000. you can forward this port in your router to your server program.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Communicate through a server
Don't use a real webserver
Write something with PB instead.
In general: normally all outgoing traffic and the answers are allowed, only incoming traffic is limited to the needed server ports.
The trick of TeamViewer and others is ...
let the user connect to something, so that the firewall/router of the user knows
that he has to allow the answers to port xyz of the customer.
Something tells the other station the open port and address for the answers.
So the other station can send data to the user directly via this address and port.
I hope this was 'understandable'.
So yoe need 'something' which is reachable from both and tell the address an port to the others.
Then they can contact each other directly via this data.
Write something with PB instead.
In general: normally all outgoing traffic and the answers are allowed, only incoming traffic is limited to the needed server ports.
The trick of TeamViewer and others is ...
let the user connect to something, so that the firewall/router of the user knows
that he has to allow the answers to port xyz of the customer.
Something tells the other station the open port and address for the answers.
So the other station can send data to the user directly via this address and port.
I hope this was 'understandable'.
So yoe need 'something' which is reachable from both and tell the address an port to the others.
Then they can contact each other directly via this data.
Last edited by infratec on Mon Oct 05, 2020 8:01 pm, edited 1 time in total.
- Kwai chang caine
- Always Here
- Posts: 5353
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Communicate through a server
Hello MkSoft
First thanks for your quick answer
You surely forget you speak to the worst programmer of the WEST
This is why i say to me, using PB master with HTTPRequest for put command on my server 1&1 and PB slave with HTTPRequestMemory for take the master command and execute it.
I have try that and nothing is locked because it's exactely what Firefox do all the day when i go to a site
First thanks for your quick answer
You surely forget you speak to the worst programmer of the WEST
Only in my dreamsyour own protocol and write it
Justely, software like the simple VNC SC (Simple clic) use this style of port and each time it's really difficult for me to configure on a WLAN networkIt is best to use a port that is not already defined with standards: Port 6000-7000
This is why i say to me, using PB master with HTTPRequest for put command on my server 1&1 and PB slave with HTTPRequestMemory for take the master command and execute it.
I have try that and nothing is locked because it's exactely what Firefox do all the day when i go to a site
The happiness is a road...
Not a destination
Not a destination
- Kwai chang caine
- Always Here
- Posts: 5353
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Communicate through a server
I hope this was 'understandable'.
Not for little KCC
The happiness is a road...
Not a destination
Not a destination
Re: Communicate through a server
Wow, you got entrance to Area 51
- Kwai chang caine
- Always Here
- Posts: 5353
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Communicate through a server
Wow, you got entrance to Area 51
No it's just my head when i crying
The happiness is a road...
Not a destination
Not a destination
Re: Communicate through a server
Something:
Client:
Connector:
Start them in this order.
I will have a look tomorrow when I run it on 3 different PCs.
Code: Select all
EnableExplicit
Structure ClientStructure
IP.i
Port.i
EndStructure
Define.i Server, Client, Len, Pos
Define Buffer$, Session$
Define *Buffer
NewMap ClientMap.ClientStructure()
InitNetwork()
Server = CreateNetworkServer(#PB_Any, 80)
Debug Server
If Server
*Buffer = AllocateMemory(1024)
If *Buffer
Repeat
Select NetworkServerEvent()
Case #PB_NetworkEvent_Data
Debug "NetworkEvent_Data"
Client = EventClient()
Len = ReceiveNetworkData(Client, *Buffer, MemorySize(*Buffer))
If Len
Buffer$ = PeekS(*Buffer,Len, #PB_UTF8|#PB_ByteLength)
Pos = FindString(Buffer$, "Session:")
If Pos
Session$ = Mid(Buffer$, Pos + 8)
Debug "Session:" + Session$
If FindMapElement(ClientMap(), Session$)
Debug "Found"
;If ClientMap()\IP <> GetClientIP(Client) And ClientMap()\Port <> GetClientPort(Client)
If ClientMap()\Port <> GetClientPort(Client)
SendNetworkString(Client, "Connect:" + IPString(ClientMap()\IP) + ":" + Str(ClientMap()\Port))
DeleteMapElement(ClientMap())
Else
SendNetworkString(Client, "Wait")
EndIf
Else
Debug "New"
If AddMapElement(ClientMap(), Session$)
ClientMap()\IP = GetClientIP(Client)
ClientMap()\Port = GetClientPort(Client)
SendNetworkString(Client, "Create:" + IPString(ClientMap()\IP) + ":" + Str(ClientMap()\Port))
EndIf
EndIf
EndIf
EndIf
Case #PB_NetworkEvent_None
Delay(10)
EndSelect
ForEver
FreeMemory(*Buffer)
EndIf
EndIf
Code: Select all
EnableExplicit
Define.i Con, Len, Server
Define Buffer$
Define *Buffer
InitNetwork()
Con = OpenNetworkConnection("localhost", 80)
Debug Con
If Con
SendNetworkString(Con, "Session:1234")
*Buffer = AllocateMemory(1024)
If *Buffer
Repeat
Select NetworkClientEvent(Con)
Case #PB_NetworkEvent_Data
Len = ReceiveNetworkData(Con, *Buffer, MemorySize(*Buffer))
If Len
Buffer$ = PeekS(*Buffer, Len, #PB_UTF8|#PB_ByteLength)
Debug Buffer$
If Left(Buffer$, 7) = "Create:"
Debug StringField(Buffer$, 3, ":")
CloseNetworkConnection(Con)
Server = CreateNetworkServer(#PB_Any, Val(StringField(Buffer$, 3, ":")))
Debug "Server:" + Str(Server)
If Server
Repeat
Select NetworkServerEvent()
Case #PB_NetworkEvent_Data
Len = ReceiveNetworkData(EventClient(), *Buffer, MemorySize(*Buffer))
If Len
Debug PeekS(*Buffer, Len, #PB_UTF8|#PB_ByteLength)
EndIf
Case #PB_NetworkEvent_None
Delay(10)
EndSelect
ForEver
EndIf
EndIf
EndIf
Case #PB_NetworkEvent_None
Delay(10)
EndSelect
ForEver
FreeMemory(*Buffer)
EndIf
EndIf
Code: Select all
EnableExplicit
Define.i Con, Len
Define Buffer$
Define *Buffer
InitNetwork()
Con = OpenNetworkConnection("localhost", 80)
Debug Con
If Con
SendNetworkString(Con, "Session:1234")
*Buffer = AllocateMemory(1024)
If *Buffer
Repeat
Select NetworkClientEvent(Con)
Case #PB_NetworkEvent_Data
Len = ReceiveNetworkData(Con, *Buffer, MemorySize(*Buffer))
If Len
Buffer$ = PeekS(*Buffer, Len, #PB_UTF8|#PB_ByteLength)
If Buffer$ <> "Wait"
Debug Buffer$
If Left(Buffer$, 8) = "Connect:"
Debug StringField(Buffer$, 2, ":") + " " + StringField(Buffer$, 3, ":")
CloseNetworkConnection(Con)
Con = OpenNetworkConnection(StringField(Buffer$, 2, ":"), Val(StringField(Buffer$, 3, ":")))
Debug Con
If Con
Debug "Send Hello"
SendNetworkString(Con, "Hello")
Delay(1000)
EndIf
EndIf
EndIf
EndIf
Case #PB_NetworkEvent_None
Delay(10)
EndSelect
ForEver
FreeMemory(*Buffer)
EndIf
EndIf
I will have a look tomorrow when I run it on 3 different PCs.
Last edited by infratec on Tue Oct 06, 2020 7:26 am, edited 1 time in total.
Re: Communicate through a server
Corrected the stuff above.
Works now on one local PC.
I have to check it on different networks. (change the addresses!)
Works now on one local PC.
I have to check it on different networks. (change the addresses!)
- Kwai chang caine
- Always Here
- Posts: 5353
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Communicate through a server
One thousand of thanks MASTER
That works here
But if the slave are not on local, That works also good ?
Furthermore the firewall ask to confirm, and it's a difficulty when the user of the slave machine is my old stepmother or my brother, who just know to push on on/off button
I search to do something like TEAMVIEWER, but in very very more simple, not security, not password
In the first time not RDP, just send command line like "create/delete folder/File", run exe, open HTML page, etc ...
After perhaps send screenshots, move mouse, enumerate folderfiles, etc ...
It's for help quickly several persons of my familly, in one clic, without have all this complex procedure to connect, etc ....
Because Teamviewer annoy me with all this update, the soft is more and more difficult to install, imposible for my familly, and i'm at the other side of the network, and i can't help them, because she not know how download new version and install it
I'm forcing to wait one or several months for install the new versions, adjust parameter on his local machine
I want create a personal tools very dangerous for the security, but often, i just need to do something during 15 mn and when my familly his in front of his machine for watch and help me by phone to do what he want
It's the reason why, i have this idea to send orders by my 1&1 server, like this, nothing to accept in the slave machine, just run the exe and wait little KCC send command
And save the very "pleasant and sweet" stepmother who hate the informatic and to see his "smile"
That works here
But if the slave are not on local, That works also good ?
Furthermore the firewall ask to confirm, and it's a difficulty when the user of the slave machine is my old stepmother or my brother, who just know to push on on/off button
I search to do something like TEAMVIEWER, but in very very more simple, not security, not password
In the first time not RDP, just send command line like "create/delete folder/File", run exe, open HTML page, etc ...
After perhaps send screenshots, move mouse, enumerate folderfiles, etc ...
It's for help quickly several persons of my familly, in one clic, without have all this complex procedure to connect, etc ....
Because Teamviewer annoy me with all this update, the soft is more and more difficult to install, imposible for my familly, and i'm at the other side of the network, and i can't help them, because she not know how download new version and install it
I'm forcing to wait one or several months for install the new versions, adjust parameter on his local machine
I want create a personal tools very dangerous for the security, but often, i just need to do something during 15 mn and when my familly his in front of his machine for watch and help me by phone to do what he want
It's the reason why, i have this idea to send orders by my 1&1 server, like this, nothing to accept in the slave machine, just run the exe and wait little KCC send command
And save the very "pleasant and sweet" stepmother who hate the informatic and to see his "smile"
The happiness is a road...
Not a destination
Not a destination
Re: Communicate through a server
KCC,
It sounds like what you have going is working for you.
To delete a file in PHP look at the PHP unlink() instruction:
https://www.php.net/manual/en/function.unlink.php
I use VNC, which is free; to communicate with my local computers. You might want to try it.
(I've heard people using it as Teamviewer with a 2nd program managing the portforwarding being sent to a server on the web)
Norm.
It sounds like what you have going is working for you.
To delete a file in PHP look at the PHP unlink() instruction:
https://www.php.net/manual/en/function.unlink.php
I use VNC, which is free; to communicate with my local computers. You might want to try it.
(I've heard people using it as Teamviewer with a 2nd program managing the portforwarding being sent to a server on the web)
Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
Re: Communicate through a server
Mytho !KCC wrote:No it's just my head when i crying
It is the son of your neighbour, when he came searching the candies for Halloween, the last year. You joked again, giving him any keys of keyboard in a bag...
- Kwai chang caine
- Always Here
- Posts: 5353
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Communicate through a server
@NORMEUS
Thanks for your help
Yes i have found for delete file in PHP
In fact, i search to not write a file, like this file is immediately deleted, i say to me it's perhaps faster to keep in memory the master order and send it to the slave
But i have not find how to do that (Passing a variable between two PHP cession, put in a variable and share it in PHP, etc ...)
My idea it's very simple and always working, because it's just request like the navigator do all the time
Like this, no password, no identification, no firewal locking or asking, no install, no port adjusting (all in 80) just run master and slave exe
Method of death so simple it is :
1/ Master send "CreateTxt KccFile.txt" to my 1&1 serveur by a http request
2/ My server writing a PHP txt file "Command.txt" with master order inside
3/ The esclave always ask to 1&1 server if he have a "command.txt" file
4/ As soon my 1&1 serveur have a "command.txt" file, the slave read and execute it
5/ The slave return to 1&1 server the answer (File created or not)
6/ The 1&1 create a text file "Answer.txt" with answer of slave inside
7/ The master read the "Answer.txt" and know if the file "KccFile.txt" is good created on the slave machine
And the miracle appears before the KCC dumbfounded eyes
The " KccFile.txt" file is creating on the slave, without panel ok, locking, etc ... it's magic
Easier you die
But i search, a way for do exactely that without create file on server, all in memory of server and 2 machines
After with this method you can all do on the other machine, all what PB can do on a local machine, then nearly ALL
Even send screenshot, enumerate folders files, etc .... and even create in master a explorerlist and reproduce the desktop with many works
Sure it's not also faster and nice than TeamViewer or VNC, but i use also me too this two softs, and i'm tired to always need to update teamviewer, enter complex password, or modify my router for port 5800/5900 sometime firewall lock and i don't know why great mother is always alone
In fact, just a simple tool, for always sure to can take control on the other machine, because each time, i spend more time to connect to the slave, than help it (And again, when it's works) and i want to throw the pc down
In local mode, all works, but when it's for great mother .....
It's another history and she feels a little lonely in the depths of her countryside with this big calculator
@OLLI
Thanks for your help
Yes i have found for delete file in PHP
In fact, i search to not write a file, like this file is immediately deleted, i say to me it's perhaps faster to keep in memory the master order and send it to the slave
But i have not find how to do that (Passing a variable between two PHP cession, put in a variable and share it in PHP, etc ...)
My idea it's very simple and always working, because it's just request like the navigator do all the time
Like this, no password, no identification, no firewal locking or asking, no install, no port adjusting (all in 80) just run master and slave exe
Method of death so simple it is :
1/ Master send "CreateTxt KccFile.txt" to my 1&1 serveur by a http request
2/ My server writing a PHP txt file "Command.txt" with master order inside
3/ The esclave always ask to 1&1 server if he have a "command.txt" file
4/ As soon my 1&1 serveur have a "command.txt" file, the slave read and execute it
5/ The slave return to 1&1 server the answer (File created or not)
6/ The 1&1 create a text file "Answer.txt" with answer of slave inside
7/ The master read the "Answer.txt" and know if the file "KccFile.txt" is good created on the slave machine
And the miracle appears before the KCC dumbfounded eyes
The " KccFile.txt" file is creating on the slave, without panel ok, locking, etc ... it's magic
Easier you die
But i search, a way for do exactely that without create file on server, all in memory of server and 2 machines
After with this method you can all do on the other machine, all what PB can do on a local machine, then nearly ALL
Even send screenshot, enumerate folders files, etc .... and even create in master a explorerlist and reproduce the desktop with many works
Sure it's not also faster and nice than TeamViewer or VNC, but i use also me too this two softs, and i'm tired to always need to update teamviewer, enter complex password, or modify my router for port 5800/5900 sometime firewall lock and i don't know why great mother is always alone
In fact, just a simple tool, for always sure to can take control on the other machine, because each time, i spend more time to connect to the slave, than help it (And again, when it's works) and i want to throw the pc down
I know there are a method for use VNC without modify port on box, all in 80, but i have try and never success to access to the slave on the WLANNormeus wrote:I use VNC, which is free; to communicate with my local computers. You might want to try it.
In local mode, all works, but when it's for great mother .....
It's another history and she feels a little lonely in the depths of her countryside with this big calculator
@OLLI
The happiness is a road...
Not a destination
Not a destination
Re: Communicate through a server
<off topic, but hope this help>Kwai chang caine wrote:Justely, software like the simple VNC SC (Simple clic) use this style of port and each time it's really difficult for me to configure on a WLAN network
If you always troubleshoot your users from the same place, use PCHelpWare (V1, not V2). It is the successor of SimpleClick.
If you have a fixed IP address you have only one address translation to do on your box. Otherwise use a dynamic dns.
You can also use the repeater.
Notes: the explanations found on the net to generate the EXE are all more unreadable one than the other, but after a lot of tests it works very well.
When I have time, I will try to make a help page on my site for this system because it took me two days to get it working. But it's works now.
</off>
- Kwai chang caine
- Always Here
- Posts: 5353
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Communicate through a server
My dear Marc, you are always an angle for me
I continue to programming my "cowpatware"
Even a children of ten years old can do better, but i'm enough proud of the result
In fact it's really simple to fully remote another machine through all the security, Firewall and other..., just by use create/delete file by PHP or FTP on server
Normally with my soft, just run one exe on each machine and master can do on the slave all what PB can do, so nearly ALL The total control what my dream
No password, encryption, security, the highway of insecurity, exactely what all good programmer never create
But this time...i'm really sure to never is locked by a firewall or security for help great mother
Sure....have RDP module is the real dream for adding to my soft, because it's more in command line "like the real ones on TV"
But for the moment ...all do by command lines is already good
I continue to programming my "cowpatware"
Even a children of ten years old can do better, but i'm enough proud of the result
In fact it's really simple to fully remote another machine through all the security, Firewall and other..., just by use create/delete file by PHP or FTP on server
Normally with my soft, just run one exe on each machine and master can do on the slave all what PB can do, so nearly ALL The total control what my dream
No password, encryption, security, the highway of insecurity, exactely what all good programmer never create
But this time...i'm really sure to never is locked by a firewall or security for help great mother
Sure....have RDP module is the real dream for adding to my soft, because it's more in command line "like the real ones on TV"
But for the moment ...all do by command lines is already good
The happiness is a road...
Not a destination
Not a destination