How to connect to bokeh server through different device in same network - bokeh

I have a Bokeh Server running on my laptop, with a simple bokeh serve --show myprogram.py and I want to be able to connect to the same server with a different device that is in the same network. For starters that would be my home network, but in the end it will be my university's network (Not sure if there is a difference).
I tried finding the IP of the laptop running the bokeh server and typing it in in my other device's browser together with the port and app name, like my_ip:5006/myprogram, however my browsers tells me that there is no response from that server.
How can I view my server from different devices?
I tried reading through the documentation however it appears to me to only talk about access when the server is embedded on other websites.

Related

Deno Server doesn't go through the Internet

I built a simple Webserver with just the serve function from the std http module. It just redirects a request to a new URL:
import { serve } from "https://deno.land/std#0.120.0/http/server.ts";
serve(req => Response.redirect("https://google.com"))
It works, when I access the server through a browser on my laptop, where the server is running, but when I try to access it on another machine in the same network using the ip-address of my laptop, there simply is no response at all. Is this one of the security features Deno has and if so, how can you deactivate it?
Update:
So I tried looking up the requests I make on my local machine in Wireshark, but when I run the server and send a request, it doesn't show up there. I disabled my Wifi Connection to see if that changes anything and to my surprise, I still got an answer from the server when I sent a request through the browser. I came to the conclusion that the Deno server somehow doesn't serve over the local network which really confuses me. Is there a way to change that behaviour?
This is not related to Deno, but rather the firewall features of your device/router/network or an error in the method that you are using to connect from the other device (typo, network configuration, etc.).
Without additional configuration (by default), serve binds to 0.0.0.0:8000, so — as an example — if your laptop is assigned the local address 192.168.0.100 by your router, you could reach the server at the address http://192.168.0.100:8000.
You might want to do research on SE/NetworkEngineering and elsewhere to determine the cause of the blocked connection.

How to forward data from desktop application through fiddler or mitmproxy?

I am using a win10 desktop app for which I know it is sending TCP packets in order to communicate with the server. The payloads are encrypted. There is a chance that if the app is using TLS, a proxy like mitmproxy or fiddler will be able to decrypt the data.
The app also gets assigned different port every time it launches. So far the only promising information was to use netsh:
netsh interface portproxy add v4tov4 listenport=appPort listenaddress=appLocalIP connectport=fiddlerListeningPort connectaddress=fiddlerLocalIP
I ran this command after the app was already running because I can not determine its local port beforehand. But that did nothing. I was unable to find any other way to force the app to route the traffic through fiddler / mitmproxy.

How to host a bokeh framework app in the internet?

I created an app with python bokeh (https://docs.bokeh.org/en/latest/). I can run it on my local system using bokeh serve --show dir. How can I host this on the internet to a wider audience?
https://github.com/Lhogeshwaran/bokeh_data_visualization
You can have a look at this post and this post. Try to run your app first on a local network like in the first example. Then if you want to make it available to the www then change the run command line as follows: --address argument should be the IP address of your webserver and if you want your Bokeh app can be viewed from any IP address then specify --allow-websocket-origin="*:5001" (or --allow-websocket-origin=*, I am not sure about exact syntax) or provide a specific IP addresses one by one to give access only to few computers. The port number 5001 is just an example. and should be the same as the port Bokeh uses (can be default 5006). Please be aware that doing so and not applying any security measures is a big risk to your computer.

Is it possible to optimally route browser data: try localhost then local network then internet

Let's say that I'm building a web app that will be required to exchange data with 3 possible entities:
Another open browser window open on the same machine.
A browser on a different machine that is still within the same intranet.
A browser on a machine outside of the intranet.
Is it possible to somehow finagle to HTTP protocol so that the data is optimally routed?
If the transfer is on the same machine, then the request should never even reach the router.
If the transfer is in the intranet, then the request should never make it onto the internet at large.
If the transfer is outside of the intranet - then so be it.
This has nothing to do with HTTP.
What you want is exactly what properly configured routing does.
You need a combination of a properly configured DNS and a router and communication with local hosts will never pass the router.

Sockets server that handles system commands and http requests

i've been searching and trying for weeks now to find a solution to my issue that I can understand and easily implement but I had no joy. So i would be very grateful if someone could put me out of my misery.
I'm building an iphone app similar in functionality to apps like "Air Video" and "Air Playit". The app should communicate with a server running on a remote host. This server should be able to execute a command sent by the iphone to encode a video and stream it over http.
In my case, my iphone app sends commands to be executed on a remote host. the remote host is running a python socket server listening for example on port 3333.
On the iphone, i'm simply using
"CFStreamCreatePairWithSocketToHost", "CFWriteStreamOpen" and
"CFReadStreamOpen"
to connect, write and read data.
My remote host, successfully intercepts the commands and starts the encoding.
To serve the contents, I'm having to run a separate http server (i'm using Python simpleHTTPServer) which is listening on another port.
What I would like to do is use the same port for both system commands and http requests.
The apps I've mentioned above seem to do it that way and I've noticed they have their own build-in web server.
I'm sure I'm missing something but please bear with me this is my first attempt at building an app.
Encode your system commands into special HTTP requests. Decide which thing to do (execute command or serve the contents) based on HTTP request, not on the incoming port. If you need to use separate http servers (like you told), consider having a layer that receives everything from the devices and dispatches to other servers (or ports) based on the request.

Resources