Jump to content

HTML5 can run without a web server?


Todi
 Share

Recommended Posts

Hello guys,

 

So, I've been developing this project and I know it's strange, but, does anyone know any type of software or technique that be able to run html5/js games and applications without a need of installing Apache or IIS?

 

I created a simple window, using Qt, with an WebView and I'd like to run my projects written in HTML5/JS.

 

Thanks! :)

Link to comment
Share on other sites

+1 to Rich's answer, two quick hints:

- If you are on mac or one of linux distros, you likely have apache built-in to your system and already running. Just find a folder, and make a symlink to your folder.

- If you are on Windows, you can get yourself up and running in 2 mins with https://code.google.com/p/mongoose/. Just run the EXE in your c:\mygames, and they will be available at http://127.0.0.1:8080. Port is configurable. 

 

However, even on Windows, you will probably find it easy to setup Apache as service once and forget about it.

Link to comment
Share on other sites

+1 to Rich's answer, two quick hints:

- If you are on mac or one of linux distros, you likely have apache built-in to your system and already running. Just find a folder, and make a symlink to your folder.

- If you are on Windows, you can get yourself up and running in 2 mins with https://code.google.com/p/mongoose/. Just run the EXE in your c:\mygames, and they will be available at http://127.0.0.1:8080. Port is configurable. 

 

However, even on Windows, you will probably find it easy to setup Apache as service once and forget about it.

 

I'm using Linux. So, I think that I will use lightppd, what you think? Because, I need to use an small and fast software to run a web server.

Link to comment
Share on other sites

Hi there,

 

yes you can run HTML5 games without a webserver.

That is: if your goal is to publish the game as an application that can be easily installed and executed.

 

I think there are several solutions these days to publish HTML5 apps as desktop applications.

 

One I tried recently and worked amazingly well is node-webkit: https://github.com/rogerwang/node-webkit

It's basically a compact chromium browser that can be packed together with the HTML5 application.

It also disables security options and therefore allows cross-domain access of files.

 

It should run on all operations systems that support chromium (Mac OX, Windows, Linux) and it runs just as well as Chrome/Chromium, with Web Audio, WebGL and so on.

 

If your goal is to develop an HTML5 game without web server... I don't think that will work out.

I'm also not sure how this will work when you have to integrate your HTML5 app inside the web view of QT. It really depends on how you can configure QT's webview.

Link to comment
Share on other sites

I haven't used linux myself but I'd have thought you could use the same python SimpleHTTPServer that I use on OSX with just couple of lines in the terminal. Here's a link that suggests that you can:

 

http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python

 

This software is really faster and trusted? I don't know in the usability of Python, but, by it be an interpreted language I think it not so trusted than lightppd, for example.
 
What I need is a faster software that get the job done as faster as it can, because I'll embed it in a Linux distro.

 

Hi there,

 

yes you can run HTML5 games without a webserver.

That is: if your goal is to publish the game as an application that can be easily installed and executed.

 

I think there are several solutions these days to publish HTML5 apps as desktop applications.

 

One I tried recently and worked amazingly well is node-webkit: https://github.com/rogerwang/node-webkit

It's basically a compact chromium browser that can be packed together with the HTML5 application.

It also disables security options and therefore allows cross-domain access of files.

 

It should run on all operations systems that support chromium (Mac OX, Windows, Linux) and it runs just as well as Chrome/Chromium, with Web Audio, WebGL and so on.

 

If your goal is to develop an HTML5 game without web server... I don't think that will work out.

I'm also not sure how this will work when you have to integrate your HTML5 app inside the web view of QT. It really depends on how you can configure QT's webview.

 

That is interesting, but I need to do an entire application that will load my packets (or the games/apps compiled to *.nw) and if it work well, not just for games, but to my application, it will be perfect, since QtWebKit is based on WebKit. i'll try this, and see how the Qt will work with.
 
But, I am worried about the support, it not even have a website official or something like that! :(
 
If it doesn't work, what you recommend? Use Lightppd or Apache or another?
Link to comment
Share on other sites

 

This software is really faster and trusted? I don't know in the usability of Python, but, by it be an interpreted language I think it not so trusted than lightppd, for example.
 
What I need is a faster software that get the job done as faster as it can, because I'll embed it in a Linux distro.

 

 

Sorry, I thought you just meant a server for running stuff locally - ignore me!

Link to comment
Share on other sites

NodeWebkit is what you need. The Node.js inside is faster than Apache especially when you need to reload tons of resources, and it's much stable than python SimpleHTTPServer (which always give you random 404...). Also you can use it to pack you project into a exec file or package. Using some node packages like http-server(from npm) helps a lot.

Link to comment
Share on other sites

NodeWebkit is what you need. The Node.js inside is faster than Apache especially when you need to reload tons of resources, and it's much stable than python SimpleHTTPServer (which always give you random 404...). Also you can use it to pack you project into a exec file or package. Using some node packages like http-server(from npm) helps a lot.

 

I'm getting this error on Ubuntu 13.04: "error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory". I know it have a fix, but, I'm worried about the inconsistence and if it will work fine with Qt! :/

Link to comment
Share on other sites

node-webkit is made by a guy from intel. Just because he doesn't have created a website for that project yet doesnt mean its immature. Its used by a lot of big companies.

 

Regarding your libudev.so error: https://github.com/rogerwang/node-webkit/wiki/The-solution-of-lacking-libudev.so.0

You should browse the wiki of node-webkit on github.

Link to comment
Share on other sites

node-webkit is made by a guy from intel. Just because he doesn't have created a website for that project yet doesnt mean its immature. Its used by a lot of big companies.

 

Regarding your libudev.so error: https://github.com/rogerwang/node-webkit/wiki/The-solution-of-lacking-libudev.so.0

You should browse the wiki of node-webkit on github.

 

I know him is from Intel and it's a huge reference, but, I don't know nothing about the functionalities using Qt WebKit. As I said, the application need to be open inside the QWebView and even I packing an application using node-webkit, as I understand, it will open in a new window. And, again I have to embed this in a board like RaspberryPI or Beagle, and my goal is to develop an entire SO, made in HTML5/JS and create my own pack to delivery the games to the final users. So, I was looking for a software or wrapper or something like that, to cut the way and working this with Qt everything in the same QWebView and don't need to work with a web server software.

 

EDIT: Yes! It works! :) Now, I'll test using Qt.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...