Example scenario:

In Japan, adult content must be censored. So what if I have a server in Japan serving a website containing only censored adult media, but also have it include a snippet of javascript which lets browser clients open a websocket connection to a server outside of Japan?

Once this websocket connection is established, the overseas websocket server sends metadata to the client, plus javascript code telling the client how to apply it to media it's streaming from the main https website connection in Japan. As a result, said media can be decensored on the client side immediately prior to showing it in a javascript based viewer.

Technically, no law-breaking content is hosted in Japan this way. However, perhaps legal systems only care about the location corresponding to the url in the browser's address bar, rather than where any data is actually hosted?

Can anyone shed some light on the legal definition of hosting, where relevant to this scenario. Not just for Japan of course, but any jurisdiction elsewhere would be informative too, including the US.