Jozef Plata
JJ_FX
About Me
EXPERTISE
Developer
Connect
LOCATION
Poland
WEBSITE
Houdini Skills
Availability
Not Specified
Recent Forum Posts
hwebserver: how to redirect POST request? June 22, 2023, 8:58 a.m.
Hi Matt,
That's because I'm trying to implement something like microservices. One server that people communicate to, which decides what needs to be done, redirects to a proper server that runs the task. So I have at least two separate hython processes.
The manager server receives a POST request from the client. The manager decides this job has to be nadled by the worker server, so it redirects to a different server (which can be the same machine, but doesn't have to). But once the request is received by a worker server, the request.method() is GET.
I can work with GET, but then the manager server has to besically take everything in request.body(), convert to a query string. Because the worker needs instructions on what to do. And depends on how much data is in the request.body() I might run out of characters in the url (I think the limit is 2048).
Redirecting the request, so it's a POST on another server, would be just less complicated for development.
That's because I'm trying to implement something like microservices. One server that people communicate to, which decides what needs to be done, redirects to a proper server that runs the task. So I have at least two separate hython processes.
The manager server receives a POST request from the client. The manager decides this job has to be nadled by the worker server, so it redirects to a different server (which can be the same machine, but doesn't have to). But once the request is received by a worker server, the request.method() is GET.
I can work with GET, but then the manager server has to besically take everything in request.body(), convert to a query string. Because the worker needs instructions on what to do. And depends on how much data is in the request.body() I might run out of characters in the url (I think the limit is 2048).
Redirecting the request, so it's a POST on another server, would be just less complicated for development.
hwebserver: how to redirect POST request? June 15, 2023, 11:02 a.m.
Hi,
So using hwebserver I cannot figure out how to redirect a request, so that's received as POST.
What I'm talking is a situation like this:
The request received on the server running on the port 5002 is always a GET request. Unless I directly send a POST request.
Can I somehow configure theso it will be received as a POST on the other server?
So using hwebserver I cannot figure out how to redirect a request, so that's received as POST.
What I'm talking is a situation like this:
# Sending from a server on port 5001 @hwebserver.urlHandler(url, is_prefix=True) def handler(request): return hwebserver.redirect(request, f'{localhost}:5002/')
# Receiving server is on port 5002 @hwebserver.urlHandler(url, is_prefix=True) def handler(request): # The request method is always GET print(f'{request.method()}') return hwebserver.Response('')
The request received on the server running on the port 5002 is always a GET request. Unless I directly send a POST request.
Can I somehow configure the
hwebserver.redirect(request)
Simul8r Project [WIP] March 15, 2023, 5:42 p.m.
Hi all!
So I've been working recently on a personal project that's a web service where you can... do simulations! Yes, simulations in the browser.
And you might ask: Ok, so what it has to do with Houdini? Well currently I'm using Houdini as an engine in the backend for the service.
The app supports only FLIP simulations, but I will keep adding other solvers before the app goes live - hopefuly somewhere around summer.
Will it scale?
https://youtu.be/ktaj06A9ufI [youtu.be]
So I've been working recently on a personal project that's a web service where you can... do simulations! Yes, simulations in the browser.
And you might ask: Ok, so what it has to do with Houdini? Well currently I'm using Houdini as an engine in the backend for the service.
The app supports only FLIP simulations, but I will keep adding other solvers before the app goes live - hopefuly somewhere around summer.
Will it scale?
https://youtu.be/ktaj06A9ufI [youtu.be]