#1 2017-02-16 16:33:09

turrican
Member
From: Barcelona
Registered: 2015-06-05
Posts: 94
Website

Streaming with THttpApiServer

Hi,

Actually I replaced (IIS 8.5 and .NET Framework 4.6 C# MVC based Application) with (Object Pascal mORMot framework using THttpApiServer). All features are working outstanding and performing better than .NET in most cases.
I want to implement multimedia streaming to client, so I need to write on headers directly before HTTP response. There is some way to do this?

Offline

#2 2017-02-16 19:30:12

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Streaming with THttpApiServer

AFAIK, currently it is not possible to communicate in raw binary mode (e.g. send raw video streaming), a new kind of record would be necessary to send binary data from the server to the client.
All communication is is done through base64-encoding (using interface based services), this will adds 30% to 50% overhead.

Offline

#3 2017-02-16 22:06:48

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,666
Website

Re: Streaming with THttpApiServer

Use a method based service.

Or a TCustomAnswer record function result.

Offline

#4 2017-02-17 09:20:11

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: Streaming with THttpApiServer

@turrican - if you need to "stream" from file just return a handle (see TSQLRestServerURIContext.ReturnFile*) and THttpApiServer will perform a chunked output out from the box if client request it (most of AV player did) - see

THttpApiServer.Execute
..
if Context.OutContentType=HTTP_RESP_STATICFILE then begin
...

Offline

Board footer

Powered by FluxBB