Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
proxy or sshtunnel (Dynamic Port Forwarding)
-
@mikael
Tried sshtunnel.
I was connected to the jump server, but I could not access the site via the jump server. -
from sshtunnel import SSHTunnelForwarder import ui server = SSHTunnelForwarder( '123.123.123.123', ssh_username='user', ssh_password='pass', remote_bind_address=('127.0.0.1',3128) ) server.start() main = ui.ScrollView(frame=(0, 0, 375, 812)) main.content_size = (375, 812) wv = ui.WebView(frame=(0, 0, *main.content_size)) wv.load_url('http://10.10.10.254') main.add_subview(wv) main.present('panel')
-
@tomomo, I suggest you check your understanding of which sshtunnel address is which. Is your jump server address really 123.123.123.123?
load_url
should use 127.0.0.1, i.e. the local endpoint of the tunnel - you can use thelocal_bind_address
to specify the port.Also, would recommend the
with ... as tunnel:
format to manage the opening and closing of the tunnel.(ScrollView is not needed, WebView can scroll on its own.)
-
@mikael
123.123.123.123 is dummy ip address.
ssh username and password is dummy.from sshtunnel import SSHTunnelForwarder import ui with SSHTunnelForwarder( 'serveripaddress', ssh_username='user', ssh_password='pass', remote_bind_address=('127.0.0.1',80), local_bind_address=('127.0.0.1',80) ) as server: wv = ui.WebView() wv.load_url('http://127.0.0.1') #wv.load_url('https://www.google.co.jp') wv.present('panel')
I also put apache in the jump server for testing.
I tried to change the source code, but I was logged in with ssh.However, the ssh session seems to be closed immediately and the process will not continue.
-
@tomomo,
present
is not modal, so the context closes immediately after, closing the tunnel.Adding
wv.wait_modal()
after it should wait until you close the view. -
You need to set up the proxy configuration in the NSURLSessionConfiguration object before creating the NSURLSession object.
-
This post is deleted! -
Yes, it is possible to use proxy or sshtunnel (Dynamic Port Forwarding) in UIWebView. However, you will need to set up your own proxy server to do so. It is important to note that UIWebView does not support SOCKS proxies, so you will need to use an HTTP proxy instead. You can get it from https://soax.com/online-facebook-messenger-proxy. To set up a proxy in UIWebView, you will need to create a configuration object to set the proxy settings. This object will contain the proxy's host, port, username, and password (if applicable) and any other required configuration settings. You can then pass this configuration object to the UIWebView instance's session configuration. This will make the proxy settings active for the UIWebView instance.
-
This post is deleted! -
This post is deleted! -
Did you manage to solve the problem?
-
Additionally, you are leaking DNS requests everywhere. Otherwise, your local computer will use your shift proxy io connection to seek DNS names, thus you must use an HTTP proxy on the SSH box. But if you're worried about being recognized, your VPS is just another IP address associated with your name. You should only use your approach if you don't trust your local connection but don't care about privacy.
-
@JacobChapman Additionally, you are leaking DNS requests everywhere. Otherwise, your local computer will use your shiftproxy.io connection to seek DNS names, thus you must use an HTTP proxy on the SSH box. But if you're worried about being recognized, your VPS is just another IP address associated with your name. You should only use your approach if you don't trust your local connection but don't care about privacy. Consider the scenario where you are using unencrypted wifi at a coffee shop. You can use your solution to visit non-SSL websites without worrying about other customers in the coffee shop spying on you.
For some reason, not all the text was posted