Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: where is indy http server root folder located? and other question if Delphi


This question is answered.


Permlink Replies: 10 - Last Post: Jan 14, 2017 4:48 AM Last Post By: roca robin
roca robin

Posts: 140
Registered: 9/10/06
where is indy http server root folder located? and other question if Delphi  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2017 10:07 AM
hi
where is indy http server(localhost) root folder located?

I opened this thread because Remy Lebeau (TeamB) said an answer about streaming from http

option number 2 if I'm not going to use resource protocol
"
2. run an HTTP server inside your app, such as with Indy's TIdHTTPServer
component, and have it return your media resource data when requested.
"

in that, I drop IndyHttpServer, start listening, make it active, but I don't know where's the path of the root folder or document root folder.

We are applying Remy Lebeau (TeamB) suggestion 2.

But when we tried to run the form with IndyHttpServer it makes a POPUP Firewall asking for private or public network, so it's OK.
We have also tried RTSP://filename..., HTTP://filename..., DATA:video//(errors), MMS://filename = none of them works!
We did not succeed, and we don't know what to do now!

We have noticed this program:
http://www.password-protect-video.com/download/password-protect-video-master.zip

"
It does NOT make any httpserver request, it does not call resource protocol
"

So, can Delphi to this things like that program did,(btw that program was build under vs c mfc)?

Actually our project is like this software, make video protection.
http://www.password-protect-video.com/

We are still figuring it out why the video file is not stored in the resource file and WHY it still can PLAY a large file size of directly, and the video is encrypted.

what protocol they are using? or what are the procedure's they follow?

well I know it needs a very good expert to answer the questions, I'm sorry all we know that we need help!

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: where is indy http server root folder located? and other question ifDelphi [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2017 11:37 AM   in response to: roca robin in response to: roca robin
roca wrote:

in that, I drop IndyHttpServer, start listening, make it active, but
I don't know where's the path of the root folder or document root
folder.

There isn't one. You manage that in your own code.

Make up a URL that you want clients to use when requesting your stream resource,
and then have your OnCommandGet event handler check if the ARequestInfo.Document
property refers to that resource or not. For example, if you want the stream
to be located at 'http://localhost/stream', then you would check if the requested
Document is '/stream' and respond accordingly.

If your server is dedicated to just streaming and nothing else, and you want
to use the URL's root, then the URL would be simply 'http://localhost' (which
canonicalizes to 'http://localhost/') and the requested Document would be
'/'. Or, you could just ignore the requested Document and always deliver
the stream on every request. But I would not suggest this, it is a good
safety catch to check the requested Document and return a 404 error for an
unknown Document.

But when we tried to run the form with IndyHttpServer it makes a POPUP
Firewall asking for private or public network, so it's OK.

As it should be, since the firewall is asking for permission to let the server
listen for clients. That is normal firewall behavior, outside of your app's
control (unless you use the firewall's own API to configure the listen rule
before activating the server).

We have also tried RTSP://filename..., HTTP://filename...,
DATA:video//(errors), MMS://filename = none of them works!

'HTTP://localhost/filename' will work fine, if you code the OnCommandGet
handler to recognize '/filename' as the requested Document.

RTSP is not HTTP, but it is similar in syntax to HTTP, so you might be
able to use TIdHTTPServer for it, though it would take some extra work to
pull off. The actual stream data is transmitted using RTP/RTCP, which are
UDP-based protocols. RTSP is used for controlling the streams.

DATA and MMS are not HTTP, and not even close to resembling HTTP, so you
cannot use TIdHTTPServer for them. You would have to use TIdTCPServer instead
and implement the protocols from scratch. However, Microsoft deprecated
MMS years ago in favor of RTSP, and even its own Window Media HTTP Streaming
protocol. You should consider using one of them instead of MMS.

We have noticed this program:
http://www.password-protect-video.com/download/password-protect-video-master.zip
"
It does NOT make any httpserver request, it does not call resource
protocol
"

Of course not, because it is processing video data directly. It takes a
video file as input, encrypts it, and slaps an EXE wrapper on it. When that
EXE is run, it knows how to decrypt and play the video data directly, without
saving it to a temp file, or using an external video player. You are not
doing any of that. You are using a video player (Windows media player) that
only works for you if you go through a file or HTTP server instead.

So, can Delphi to this things like that program did,(btw that program
was build under vs c mfc)?

Delphi, being a native development tool, can be used to do anything other
programs can do. It is just a matter of coding. But based on your earlier
messages, you are not willing to do the hard work yourself (and video and
encryption are hard to work with), you want a ready-made solution, and that
requires dealing with their limitations. If you want something more like
what that other app can do, you will have to find an encryption solution
that allowws you to access the raw video data as it is being decrypted, and
you will need to find a video player that allows you to stream the decrypted
video data to it in real-time. That way, you can decrypt some data, send
it to the player, decrypt some more data, send it to the player, and so on.

Otherwise, you will just have to decrypt the video to a temp file and play
that as-is, which sounds like something you don't want to do.

what protocol they are using?

Based on the description on their website, it sounds like None.

--
Remy Lebeau (TeamB)
roca robin

Posts: 140
Registered: 9/10/06
Re: where is indy http server root folder located? and other question ifDelphi [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2017 12:38 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

Of course not, because it is processing video data directly. It takes a
video file as input, encrypts it, and slaps an EXE wrapper on it. When that
EXE is run, it knows how to decrypt and play the video data directly, without
saving it to a temp file, or using an external video player. You are not
doing any of that. You are using a video player (Windows media player) that
only works for you if you go through a file or HTTP server instead.

Actual Test, I deleted the Windows Media Player Folder for Both x86 and x64

then I run the other application with large 890mb file, then the application show it self says"connecting..." + "opening media..." then PLAYS the video.

PLAYS USING "Windows Media Player".

it's the same procedure I have,
I run my application with 5mb file, the application shows and say"opening media...." then PLAYS the video.

So, there was no "connecting message...." from my application, BUT the other application has which means I think it's connecting to a localhost!

I know the applications both are using "wmp.dll" it's a "portanble executable(PE)"

So, I think there is a "TRADE SECRET" applied to that other application.
and I don't think it's using "RES protocol"

I hope there is an idea of what did that application do to play the video very good under a large file size.
The application of the other video file size is only 1.4mb, then adds the encrypted video file to the END of the File.

So res protocol can't or don't know that, maybe another protocol?

What you say?

thank you for your outstanding answerS.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: where is indy http server root folder located? and other questionifDelphi [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2017 1:01 PM   in response to: roca robin in response to: roca robin
roca wrote:

Actual Test, I deleted the Windows Media Player Folder for Both
x86 and x64

then I run the other application with large 890mb file, then the
application show it self says"connecting..." + "opening media..."
then PLAYS the video.

PLAYS USING "Windows Media Player".

I seriously doubt that, especially since you deleted it beforehand. Unless
the app has its own copy of WMP that it uses privately.

it's the same procedure I have, I run my application with 5mb file,
the application shows and say"opening media...." then PLAYS the video.

But you haven't explained HOW you are opening/playing the file.

So, there was no "connecting message...." from my application, BUT
the other application has which means I think it's connecting to a
localhost!

Then maybe the app runs its own private media server for that purpose. You
dont know for sure.

So, I think there is a "TRADE SECRET" applied to that other application.

Obviously, just like with any other third-party app, and certainly when dealing
with encryption.

and I don't think it's using "RES protocol"

I never said it was. It is more likely to be accessing the resource data
DIRECTLY (see the Win32 API FindResource(), LoadResource(), and LockResource()
functions, or the Delphi RTL's TResourceStream class) then streaming the
resource through a URL transport layer.

I hope there is an idea of what did that application do to play the
video very good under a large file size.

I already gave you my ideas on that. If you want to know exactly how the
other app does what it does, ASK THE AUTHOR, but don't expect an answer.

The application of the other video file size is only 1.4mb

It is likely using a pre-written stub. The stub is coded to look for its
data at a particular location in the file, and then when needed the stub
is copied and its data is stored at that location.

Self-extracting archives use the same thing.

then adds the encrypted video file to the END of the File.

Or more likely, to a resource within the EXE (see the Win32 API BeginUpdateResource()
and UpdateResource() functions). Although the video could simply be appended
to the very end of the EXE file, it is not always beneficial to do so, but
still possible if the data is marked in such a way that the EXE can find it.

So res protocol can't or don't know that, maybe another protocol?

There is no protocol that would be able to access data that is simply appended
to the end of the EXE file. Nor would there need to be one, if the EXE already
knows where to look for the data. You are focusing too much on "protocols"
when one is likely not even being used in the first place.

--
Remy Lebeau (TeamB)
roca robin

Posts: 140
Registered: 9/10/06
Re: where is indy http server root folder located? and other questionifDelphi [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2017 2:18 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

I seriously doubt that, especially since you deleted it beforehand. Unless
the app has its own copy of WMP that it uses privately.
No, the app has NO copy of wmp, I had look to the PE resources, and even get the original PE out from exe with video.
here's a screen shot image I'v take:
http://www.mediafire.com/file/0zyf2wl3w2b6mjw/THISMOVIE.jpg

But you haven't explained HOW you are opening/playing the file.
I opened the file by just double clicking, or just enter it as normal executable files.

Then maybe the app runs its own private media server for that purpose. You
dont know for sure.
No, I had look at it, but I have to disable my network before that, because at first when I try it, I used the process explorer, then see the TCP, it has a remote SIGNATURE routing to linode.com , so I think it's registering whoever used the application or downloading a CODEC OR TAKING screenshot of the Video(I suspected it-because I have look the debug information code). The rest of the PE under the video exe file are 7z and other has small BYTES and I don't know what are those for. I did not see the original PE or EXE that was used for the fire-UP of the video image.
IF I disable my internet then it's not routing to it.. .BUT STILL it plays the video very good.

and STILL it plays EVEN if I renamed the folder because the WMP.DLL was the only one used to LOAD the EXE.

I will TRY TO DELETE the WMP.DLL from outside another OS, then this will truly know that the other application is running STANDALONE Video Protected EXE.
IF the Application WILL not Opened then the Application is REALLY running under Windows Media Player dependency, But still a standalone application.
I failed, I can't rename or delete wmp.dll,
tested under windows XP, error...it says' downloading CODEC... does not play video, ONLY AUDIO.... BUT still it plays on Windows Media Player Hood!

Really it's just like my test application here, but it's not running from res Protocol. but I still doubt there is a secret to CALL filesize POINT to the video image located (like at the end of FILE targeted).

anyway, I know this is behind your HELP LIMIT, so much trouble here.

thank you for all of your positive responses, I'd like to closed this thread answered and HELPED.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: where is indy http server root folder located? and otherquestionifDelphi [Edit] [Edit]
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2017 3:12 PM   in response to: roca robin in response to: roca robin
roca wrote:

No, the app has NO copy of wmp, I had look to the PE resources,
and even get the original PE out from exe with video.

You clearly do not understand how PE resources or DLLs actually work. I
was not suggesting that the WMP DLL was in the app's resources. But since
WMP is available in DLL form, I was suggesting maybe the app had a copy of
wmp.dll in its own installation. If you use a tool like SysInternal Process
Explorer, you can see what DLLs the app actually has loaded and where they
are loaded from.


Next time, please post files to the Attachments formum on this server. Don't
use an external hosting service.

All that image tells me is that the app in question has an embedded video
player, but not how that player is implemented. You keep insisting it is
WMP, what is your basis for that conclusion?

I opened the file by just double clicking, or just enter it as normal
executable files.

<sigh> I meant, how you are trying to open/play the file in YOUR OWN APP.

IF I disable my internet then it's not routing to it.. .BUT STILL it
plays the video very good.

I would expect it to, if it is reading the encrypted video data directly
from its own EXE file directly, decrypting it in memory, and playing whatever
is decrypted in its own video player. What is so hard to understand about
this?

and STILL it plays EVEN if I renamed the folder because the WMP.DLL
was the only one used to LOAD the EXE.

Did you RENAME the folder, or DELETE the folder? It makes a big difference.
If you RENAME a folder/file, some areas of the OS, such as Registry entries
for COM object registrations, can be automatically updated with the new path.
If you DELETE a folder/file, that does not happen.

Really it's just like my test application here, but it's not running
from res Protocol. but I still doubt there is a secret to CALL
filesize POINT to the video image located (like at the end of FILE
targeted).

It can't do that anyway, since the source data is encrypted. The app HAS
to decrypt the data before feeding it into the video player. For instance,
let's say the app really is embedding WMP. Maybe the app has installed a
custom WMP driver/filter that can handle the encrypted video. The app points
the player to the raw video data, and then as the player reads the video
data through the driver/filter, it get decrypted live while playing. Who
knows.

--
Remy Lebeau (TeamB)
roca robin

Posts: 140
Registered: 9/10/06
Re: where is indy http server root folder located? and otherquestionifDelphi [Edit] [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2017 3:55 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
If you use a tool like SysInternal Process
Explorer, you can see what DLLs the app actually has loaded and where they
are loaded from.

Yes I used that, so I did not see any other load of file aside from the video exe it self.

I was suggesting maybe the app had a copy of
wmp.dll in its own installation.
the app is a standalone exe, no installation needed.
the app is using the default GUI of the windows media player(twindowsmediaplayer1)

Next time, please post files to the Attachments formum on this server. Don't
use an external hosting service.
I did but I did not see the link I update or change the line
ok, here is goes,
[this is the link inserted here|http://www.mediafire.com/file/0zyf2wl3w2b6mjw/THISMOVIE.jpg]

I would expect it to, if it is reading the encrypted video data directly
from its own EXE file directly, decrypting it in memory, and playing whatever
is decrypted in its own video player. What is so hard to understand about
this?
yes I understand you, sorry

Did you RENAME the folder, or DELETE the folder? It makes a big difference.
If you RENAME a folder/file, some areas of the OS, such as Registry entries
for COM object registrations, can be automatically updated with the new path.
If you DELETE a folder/file, that does not happen.
yes I only rename the DLL, I can't delete it, so in the image It was shown.

Ok,
Really thank you for the thoughts,
so I think we will apply your Number 2 suggestion, is to used the Indy Http Server.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: where is indy http server root folder located? andotherquestionifDelphi [Edit] [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2017 6:47 PM   in response to: roca robin in response to: roca robin
roca wrote:

Yes I used that, so I did not see any other load of file aside from
the video exe it self.

Then it is probably NOT using WMP.

the app is a standalone exe, no installation needed. the app is using
the default GUI of the windows media player(twindowsmediaplayer1)

You said earlier that YOUR app uses the VCL's TMediaPlayer component. That
is a wrapper for the MCI API (not WMP):

https://msdn.microsoft.com/en-us/library/windows/desktop/dd757151.aspx

MCI is capable of streaming video using the IAVIFile/IAVIStream interfaces
instead of a filename:

https://msdn.microsoft.com/en-us/library/dd798002.aspx

https://msdn.microsoft.com/en-us/library/dd798010.aspx

Or, using a custom I/O callback registered with mmioInstallIOProc():

https://msdn.microsoft.com/en-us/library/windows/desktop/dd757323.aspx

In theory, a custom class implementing IAVIStream, or a callback function,
could decrypt data live during video playback.

Here is a Delphi example of using MCI for streaming video:

Using MCI to play video multimedia content from a stream
http://www.ciuly.com/delphi/multimedia/using-mci-to-play-video-multimedia-content-from-a-stream/

I'm sure you could adapt it to add decryption on top of the streaming.

Who knows what the 3rd party app uses internally.

Next time, please post files to the Attachments formum on this
server. Don't use an external hosting service.
I did

When I say Attachments forum, I am referring to this page:

https://forums.embarcadero.com/forum.jspa?forumID=2

but I did not see the link I update or change the line
ok, here is goes,
[this is the link inserted here|http://www.mediafire.com/file/0zyf2wl3w2b6mjw/THISMOVIE.jpg]

Again, you are still posting a link to an external site, instead of posting
the actual file to this server. But it doesn't matter, since I've already
seen it and commented on it.

--
Remy Lebeau (TeamB)
roca robin

Posts: 140
Registered: 9/10/06
Re: where is indy http server root folder located? andotherquestionifDelphi [Edit] [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2017 8:39 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
I'm sorry for the external link, I still don't know that, next time I will try to make it better.

yes, first I used TMediaPlayer, BUT you suggested TWindowsMediaPlayer, so I followed you.

using MCI does not play mp4 or mkv files, only AVI, so I'm not using it.

anyway, I've found out that the OTHER application was using its own video pluggin (DSP), so I think that is the answer why the OTHER application can load its own EXE to play with WMP.

thank you for all the inputs, this site is lonely without you.

glad to be here.
see you around.

again thank you so much

Edited by: roca robin on Jan 12, 2017 11:20 PM

NO! The Video DSP Plugin was NOT the one who cause playing the EXE, it's the EXE who really load itself into stream with the WMP(I dissected the plugin, is used when there is no CODEC installed it will FLASH images, AUDIO functions only).

So, 3rd Party Software was USED in the OTHER application, but really the other application uses WMP as the source for playing video files.

nothing more to Add! Thread Closed and Answered!

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: where is indy http server root folder located?andotherquestionifDelphi [Edit] [Edit] [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 13, 2017 3:23 PM   in response to: roca robin in response to: roca robin
roca wrote:

using MCI does not play mp4 or mkv files

It does if the appropriate codecs are installed.

--
Remy Lebeau (TeamB)
roca robin

Posts: 140
Registered: 9/10/06
Re: where is indy http server root folder located?andotherquestionifDelphi [Edit] [Edit] [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 14, 2017 4:47 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
It does if the appropriate codecs are installed.
I never seen that before, that's why they gave up only with avi.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02