Skip to content

Commit 1e34494

Browse files
committed
fix mot new urls
1 parent f7d3050 commit 1e34494

3 files changed

Lines changed: 21 additions & 51 deletions

File tree

HTTP_PROXY.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# HTTP Proxy
2+
3+
We use an HTTP Proxy to access the SIRI data from MOT allowed IP
4+
5+
The proxy is running on server hasadna-proxy1 (see hasadna-iac for terraform configuration setting it up and to get access)
6+
7+
To access from local PC you need to create an SSH tunnel to this server:
8+
9+
```
10+
ssh hasadna-proxy1 -L 9999:172.16.0.5:9999 -N
11+
```
12+
13+
Then set the HTTP_PROXY and HTTPS_PROXY environment variables to point to the local end of the tunnel:
14+
15+
```
16+
export HTTP_PROXY=http://localhost:9999
17+
export HTTPS_PROXY=http://localhost:9999
18+
```

SSH_TUNNEL.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

open_bus_siri_requester/requester.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
REQUEST_URL_TEMPLATE = "https://moran.mot.gov.il/Channels/HTTPChannel/SmQuery/2.8/json?Key={Key}&MonitoringRef=AllActiveTripsFilter&StopVisitDetailLevel=normal"
17-
ALT_REQUEST_URL_TEMPLATE = REQUEST_URL_TEMPLATE # need to get the new backup url
17+
ALT_REQUEST_URL_TEMPLATE = "https://moran-t.mot.gov.il/Channels/HTTPChannel/SmQuery/2.8/json?Key={Key}&MonitoringRef=AllActiveTripsFilter&StopVisitDetailLevel=normal"
1818

1919

2020
@contextlib.contextmanager
@@ -73,7 +73,8 @@ def _request(use_alt=False):
7373
with start_ssh_tunnel() as proxies:
7474
try:
7575
res = requests.get(
76-
request_url, proxies=proxies, timeout=config.OPEN_BUS_REQUESTER_TIMEOUT_SECONDS
76+
request_url, proxies=proxies, timeout=config.OPEN_BUS_REQUESTER_TIMEOUT_SECONDS,
77+
verify=False
7778
)
7879
except:
7980
traceback.print_exc()

0 commit comments

Comments
 (0)