Associating a Rebol 2 Port with Multiple IP Addresses

I have a Windows installation with multiple IP addresses and I want my Rebol script (on Rebol / Core 2.78) to individually bind and listen on the same port number on each of these IP addresses.

Until recently, I thought the syntax for this is:

Port1Test: open/lines tcp://:80   browse http://10.100.44.6?
Port2Test: open/lines tcp://:80   browse http://10.100.44.7?

But it turns out that the line Port2Testfails because the part is browse http://10.100.44.6?completely ignored (and now it cannot find the place where I got this syntax in the first place). Reading the documentation I can find in how to specify the listening port is as follows:

Port1Test: open/lines tcp://:80

Checking the port Port1Testshows that most of the settings are set to none, and several of them are set as follows:

scheme: 'tcp
host: none
port-id: 80
local-ip: 0.0.0.0
local-port: 80

, :

Port1Test: open/lines tcp://:80  ; Create port, as before. Then modify below
Port1Test/host: 10.100.44.6      ; Might this be the binding interface?
Port1Test/port-id: 1             ; I guess this is just an id?
Port1Test/local-ip: 10.100.44.6  ; This ought to be the binding interface.

Port2Test: open/lines tcp://:80  ; Create port, as before. Then modify below
Port2Test/host: 10.100.44.7      ; Might this be the binding interface?
Port2Test/port-id: 2             ; I guess this is just an id?
Port2Test/local-ip: 10.100.44.7  ; This ought to be the binding interface.

, , IP Port1Test Port2Test, Port2Test.: - (

, -, , , , .

!


Edit: , Rebol , , , .

, IP- (== ), : 10.100.1.1 10.100.1.2. 10.100.1.1:80 Tomcat, , , . REBOL, 80. , IP-, Rebol 10.100.1.2. Tomcat . , . IP-, , Rebol IP-.

Rebol, , , Rebol 0.0.0.0 ( 0.0.0.0 " IPv4- " ), .

, Rebols 0.0.0.0 - !

+4
1

Rebol2 IPv4 (0.0.0.0), , , .

FYI, Rebol2 IPv4, interfaces:

>> p: open tcp://:8000
>> probe get-modes p 'interfaces
[make object! [
        name: "if19"
        addr: 10.27.10.110
        netmask: 255.255.255.252
        broadcast: 10.27.10.111
        dest-addr: none
        flags: [broadcast multicast]
    ] make object! [
        name: "lo0"
        addr: 127.0.0.1
        netmask: 255.0.0.0
        broadcast: none
        dest-addr: none
        flags: [multicast loopback]
    ] make object! [
        name: "if16"
        addr: 192.168.1.4
        netmask: 255.255.255.0
        broadcast: 192.168.1.255
        dest-addr: none
        flags: [broadcast multicast]
    ]]

, ... ( , ).

, .

+1

Source: https://habr.com/ru/post/1624194/


All Articles