Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Proxy PAC - Prüfung auf Source und Destination

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich bin gerade daran eine Proxy PAC Datei zu erstellen. Diese schreibt man ja im JavaScript.

Bisher funktioniert sie auch einwandfrei jedoch müsste ich nun noch den Fall reinbringen das auf die Source IP Adresse sowie Destination IP Adresse geprüft wird.



function FindProxyForURL(url, host)
{

var client = myIpAddress();
var use_proxy = "PROXY prx-beenode00.ems.de:8080; DIRECT";

if (
shExpMatch(url, "*.sec.beeno.de/*") || // intern
shExpMatch(url, "*.sec.beeno.de:*/*") || // intern
shExpMatch(url, "gopher:*") // GOPHER
)

{
return "DIRECT";
}
if (
isInNet(host, "10.0.0.0", "255.0.0.0") || // privat
isInNet(host, "127.0.0.0", "255.0.0.0") || // localhost
isInNet(host, "172.16.0.0", "255.240.0.0") || // privat
isInNet(host, "192.168.0.0", "255.255.0.0") // privat
)

return "DIRECT";
else
return use_proxy;
}
[/PHP]

Wie bekomme ich da nun noch rein wenn Source IP in das Netz 40.32.0.0/16 fällt und auf das Ziel 80.44.32.0/24 zugreifen will nicht den Proxy zu benutzen?

Ich denke die Aufgabe ist nicht zu schwer nur wenn man keine Ahnung von JavaScript hat wie ich :P

Würde mich über eine Antwort freuen :)

Keiner eine Idee? :confused: :(

ICh kenne jetzt grad die Syntax davon nicht, aber ich denke mal, mittels einer Verschachtelung, oder UND-Verknüfung sollte das doch eigentlich kein Problem sein.

Wieso unterteilst du die IF-Abfrage nach URL oder IP?

Also so:

if(Bedingung1 && Bedingung2 || Bedingung 3 || ... ){
return "DIRECT";
}else
return use_proxy;
[/PHP]

Wie genau die Bedingungen lauten weiss ich jetzt auf Anhieb nicht.

Bedingung 1 = Quelle ist das Netz 40.32.0.0/16

Bedingung 2 = Ziel ist das Netz 80.44.32.0/24

Bedingung 3 = eine unabhängige Bedingung bei der das auch so sein soll...

Bearbeitet von Crash2001

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.