Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9218879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:58:06+00:00 2026-06-18T02:58:06+00:00

I am using the following js plugin which allows me to use WebSockets on

  • 0

I am using the following js plugin which allows me to use WebSockets on android and iOS with apps written in html5 (via phonegap in my case).

https://github.com/FreakDev/PhoneGap-Android-HTML5-WebSocket

What else do I need in order to use a websocket?

I have a basic server with bluehost that has PHP and MySQL installed.. What am I going to need to do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:58:07+00:00Added an answer on June 18, 2026 at 2:58 am

    First you can use a library like this one:
    http://code.google.com/p/phpwebsocket/

    Second, your host must let you create sockets. This mean PHP must have php_sockets.dll (Win) or sockets.so (Linux) extension enabled and a forwarded port from your server.
    Also you need to run your php from commend line or somehow keep it alive for ever.

    It is just like creating a normal socket in PHP.

    *Edit:

    1. WebSockets are just some sort of normal sockets. In websocket you can connect to a endpoint which is listening for connections and then communicate with it. Just like normal sockets but with simple differences in protocol and more limitations. For doing so you need a script or application to run for ever and handle all connections from webpages. But a php file will end just after request ended. For keeping a php file running for ever you need to run it from commend line which mean you need to have shell access, or you can use this code to run your php script for ever: (But you must think about a mechanism to call it only once)

      ignore_user_abort(true);

      ini_set(‘max_execution_time’, 0);

      set_time_limit(0);

    2. You can test. If your application fail with error messages about not knowing a function like socket_connect or socket_bind then you don’t have socket extension for php.

    3. Here is phpwebsocket files for download:
      http://phpwebsocket.googlecode.com/svn/trunk/%20phpwebsocket/
      There is an example there too.

    4. As “Tom van der Woerdt” said PHP is not designed for doing socket programming. Go for a non-scripting language and use a dedicated server or at least a vps for opening and managing sockets.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the PhoneGap LocalNotification plugin, which allows me to set local notifications
I am using Jquery tokenizer as like facebook using the following plugin http://loopj.com/jquery-tokeninput/ which
I'm using jQuery Autocomplete plugin which, generates following markup when suggestions show up. <ul
I'm using the Grails routing plugin which allows defining Camel routes with a Groovy
I am using a polls plugin which generates the following HTML: <div class=pane> <ul
Using the jQuery Cycle plugin, the following code allows user to browse the photos/:
I am using the following plugin http://playground.mobily.pl/jquery/mobily-notes/demo.html which gives a very good stack, but
I am using following plugin http://pinesframework.org/pnotify/ I am creating dialog using following jquery code..
I am using the following plugin: http://flowplayer.org/tools/scrollable.html and under the sub-heading of Scripting API
I am using the following plugin: http://codecanyon.net/item/dynamic-step-process-panels/118950 and I am trying to modify its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.