Comments (8)
Yes, this is a regression. I'll see to it some time when I get back in front of my PC next week.
from vbasyncsocket.
Thanks a much for your time to fix ip. That works now.
I have several questions about it, if you don't mind.
Sorry, if they are too noob-like.
Following image demonstrates sending packets from host to guest VM and vice versa (that is a previous patch w/o port fix yet):
Host:
ip - 192.168.31.4
gateway - 192.168.31.1
VM:
ip - 192.168.202.169
gateway - 192.168.202.1
-
When I listen on "localhost" or "127.0.0.1" (no matter VM, or host) I cannot send a packet - saying "cannot connect ..."
Is it a normal behaviour? The only way to receive a packet between network interfaces is to set the listener on current ip (192.168.31.4 (host) or 192.168.202.169 (vm)). -
Listener (on host) said that the packet came from 192.168.31.4 which is its own ip! That is not correct since I sent it from vm.
Vice versa. Litener on VM said that the packet came from 192.168.202.1 which is its gateway =)
Maybe it is some specific behind inter-network interfaces transferring mechanism, so packet is losing info about its original sender... -
Another case. Maybe you could suggest how correctly open port to see it externally from Internet and be able to send packets?
- I made port forwarding on 8088 in my router.
- I added inbound and outbound rule for Listener application to my windows firewall.
- I set listener on "localhost" with that port.
Now I connected via RDP to another physical machine out of my local network to test is my port 8088 opened,
e.g. site: https://www.yougetsignal.com/tools/open-ports/
however, it shows me that the port is closed. Surely, this powershell command also failed:
Test-NetConnection my.external.ip.address -Port 8088
- Also, I tried to set Listener on "my.external.ip.address" instead of "localhost", but such operation failed with runtime error: "Required address is incorrect for its context".
Very appreciate your answers, when you have time.
from vbasyncsocket.
When I listen on "localhost" or "127.0.0.1" (no matter VM, or host) I cannot send a packet - saying "cannot connect ..."
Try listen on 0.0.0.0
. This will listen both on localhost and all other assigned local IPs.
. . . said that the packet came from 192.168.31.4 which is its own ip
Is this VirtualBox? (No, I see it's VMWare now.) It uses NAT for VM networks by default. Try setting network to bridged and assign IP from your real LAN card subnet.
. . . made port forwarding on 8088 in my router.
If your VM is bridged it has "real" IP from your LAN subnet so you can forward directly to it. If forwarding is not working to your real machine probably listener was setup incorrectly on 127.0.0.1
.
When you start listener on 0.0.0.0
the Windows Firewall will popup a dialog suggesting to add your application to firewall inbound rules. This will be an indication your listener is setup correct :-))
from vbasyncsocket.
Lot of thanks for your detailed explanations! They was very helpful. Everything works.
One question: by design, when we are listening for a "localhost" only "preferred" network interface is catched.
What if we have 2 local network interfaces, but I want to listen for that second localhost interface (without 0.0.0.0, so a port should be invisible to the world). Is it possible?
from vbasyncsocket.
You have to listen to a specific local IP address that is assigned to this second LAN adapter.
Since commit 186a4dd you can use GetLocalHost
method to retrieve an array with all local IPs as returned from GetAdaptersInfo
API.
I can tweak it to return more info like network name or default gateway address, not only IP and subnet mask as currently impl.
from vbasyncsocket.
Is there a method to pass the whole array of IPs (subnet) from the second adapter to listen for?
from vbasyncsocket.
No, you can either bind a socket on 0.0.0.0
(so called INADDR_ANY
to listen on all local IPs) or bind it to a single local IP address.
127.0.0.1 is the IP address of the local loopback adapter but so is 127.0.0.2 and every other address in 255.0.0.0 subnet so you can listen on (and connect to) all these addresses too.
from vbasyncsocket.
Ok, thank you.
I was thinking about trick to temporarily make second adapter to be preferred, then server.Listen "localhost", than return first adapter to be "preferred". Not sure, can it work that way =) Perhaps better just listen for 0.0.0.0 and use firewall to restrict external access to a port.
from vbasyncsocket.
Related Issues (20)
- VBA compatibility HOT 4
- Need another way for accepting incoming socket requests HOT 1
- cTlsSocket does not fire OnConnect HOT 1
- mdTlsNative will not make a connection HOT 1
- Samples for cAsyncSocket.cls HOT 1
- Https not supported HOT 3
- cHttpRequest is duplicating the first ~3389 bytes of XML response HOT 17
- Small behavior difference between WinHTTP and VbAsyncSocket HOT 2
- 64bit conversion HOT 4
- Connect to FTP(S) -Server
- VB6 App : Runtime error on Win 10 22H2 on Macbook using Boot Camp HOT 12
- Possible using mdTlsThunks for a TLS 1.0 server? HOT 6
- SSL 2.0 with mdTlsNative as server, web browser as client gets no response back HOT 4
- Crashes in VB5 IDE HOT 8
- Problems using TLSsocketz HOT 11
- Missing dependency HOT 1
- [Improvement] Reg-Free manifest HOT 1
- [Improvement] More simple samples on separate Client-Server apps HOT 6
- [Improvement] Forcibly free the port HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vbasyncsocket.