{% extends "header.html" %} {% block body %}
In this PyGame with Python 3 programming tutorial, we cover how we can convert our PyGame into an executable, or an installer, which we can then share with people who do not have Python installed, or pygame... etc. We will do this using cx_Freeze, which is a very similar module to py2exe for those who are familiar.
The reason why you may want to convert your game into an executable is so that you can share it with people who may not have PyGame or Python installed.
In order to use cx_Freeze, you will need to download and install it. The official source is: cx_Freeze website/
Some people have had problems with the official source, so you can use a patched version, found here instead: http://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze
Make sure you match the bit version (32 or 64 bit) with your bit version of Python.
Once you have cx_Freeze installed, you're ready to convert your game to an executable or an installer.
First, you will want to make a setup.py file with the following contents:
import cx_Freeze executables = [cx_Freeze.Executable("pygameVideo15.py")] cx_Freeze.setup( name="A bit Racey", options={"build_exe": {"packages":["pygame"], "include_files":["racecar.png"]}}, executables = executables )
The above is converting the python script contained under the file name: pygameVideo15.py
From there, we specify the name of the application, then we explicitly notify cx_Freeze that we are using the pygame module, and we explicitly tell it that we have an included file, which is racecar.png.
cx_Freeze can sometimes figure out modules that you're using, but sometimes not. Following with typical Pythonic precepts, explicit is better than implicit, so let's be clear!
Once you've done that, you'll want to navigate to your terminal and make your way to the directory containing your Python game script and the setup.py script.
Then, type:
python setup.py build.
If you get an error stating that Python is not in your path, then give the full path. For example, on Windows, with Python 3.4, you would do:
C:/Python34/python setup.py build
From there, you should get a build directory, within it will be an executable that will run your script.
You can also do something like:
python setup.py bdist_msi
That will generate a Windows installer.
There are various errors and issues that you might run in to while using cx_Freeze. Check out the video for some of the possible issues. Google can also be a massive help, and some times... just sometimes ... the documents can help a ton!


Rock · Paper · Scissors · Lizard · Spock
"Scissors cuts Paper. Paper covers Rock. Rock crushes Lizard. Lizard poisons Spock. Spock smashes Scissors. Scissors decapitates Lizard. Lizard eats Paper. Paper disproves Spock. Spock vaporizes Rock, and, as it always has, Rock crushes Scissors." - Dr. Sheldon Cooper (The Big Bang Theory)
I had fun making this, and, as a result, I went a little above and beyond with it. My instructor says I should include the splash screen animation...


Windows Live
™
Close window
Print
Jane User
Personal e-mail
<EMAIL_ADDRESS>(preferred e-mail address)
Home phone
2068675309
Mobile phone
2068675308
Company
Example, Inc.
Work e-mail
<EMAIL_ADDRESS>Work phone
2068675307
Joe User
Personal e-mail
joe.user@example.com


My Thermostat
Check a city temperature. Go on
Current temperature:
Temperature inside:
+
-
reset
Power saving mode is
on
Power usage is
medium
PSM on
PSM off
Control your temperature.
Check your cities temperature.
Endless fun.


It is a memory that work on the principal of LIFO i.e. last in first out.
1) LIFO2) PUSH3) POP
PUSH: Push the value on the top of the stack memory.
POP: Pop or retrieve or read and delete the value from the top of the stack memory.


|
Physics2D
|
A 2D Physics enabled screen. More...
Inherits Screen, and b2ContactListener.
Public Member Functions | |
| PhysicsScreen (Number worldScale, Number freq, int velIterations=10, int posIterations=10) | |
| Creates a new physics screen. | |
| PhysicsScreen () | |
| Default constructor. | |
| PhysicsScreenEntity * | addPhysicsChild (ScreenEntity *newEntity, int entType, bool isStatic, Number friction=0.1, Number density=1, Number restitution=0, bool isSensor=false, bool fixedRotation=false, int groupIndex=0) |
| Adds a ScreenEntity as a physics enabled child. More... | |
| PhysicsScreenEntity * | trackPhysicsChild (ScreenEntity *newEntity, int entType, bool isStatic, Number friction=0.1, Number density=1, Number restitution=0, bool isSensor=false, bool fixedRotation=false, int groupIndex=0) |
| Tracks a ScreenEntity as a physics enabled child. More... | |
| void | stopTrackingChild (ScreenEntity *entity) |
| Stops physics tracking for this entity but does not remove from screen. More... | |
| void | removePhysicsChild (ScreenEntity *entityToRemove) |
| Removes a physics child from the screen. More... | |
| PhysicsScreenEntity * | addCollisionChild (ScreenEntity *newEntity, int entType, int groupIndex=0, bool sensorOnly=true) |
| Begins tracking collisions for a ScreenEntity and adds it to the scene. More... | |
| PhysicsScreenEntity * | trackCollisionChild (ScreenEntity *newEntity, int entType, int groupIndex=0) |
| Begins tracking collisions for a ScreenEntity. More... | |
| void | destroyJoint (PhysicsJoint *joint) |
| Removes an existing joint. More... | |
| PhysicsJoint * | createDistanceJoint (ScreenEntity *ent1, ScreenEntity *ent2, bool collideConnected) |
| Creates a new distance joint. More... | |
| PhysicsJoint * | createPrismaticJoint (ScreenEntity *ent1, ScreenEntity *ent2, Vector2 worldAxis, Number ax, Number ay, bool collideConnected=false, Number lowerTranslation=0, Number upperTranslation=0, bool enableLimit=false, Number motorSpeed=0, Number motorForce=0, bool motorEnabled=false) |
| Creates a new prismatic joint. More... | |
| PhysicsJoint * | createRevoluteJoint (ScreenEntity *ent1, ScreenEntity *ent2, Number ax, Number ay, bool collideConnected=false, bool enableLimit=false, Number lowerLimit=0, Number upperLimit=0, bool motorEnabled=false, Number motorSpeed=0, Number maxTorque=0) |
| Creates a new revolute joint. More... | |
| void | applyForce (ScreenEntity *ent, Number fx, Number fy) |
| Applies linear force to an entity. More... | |
| void | applyImpulse (ScreenEntity *ent, Number fx, Number fy) |
| Applies an impulse to an entity. More... | |
| void | setGravity (Vector2 newGravity) |
| Sets the gravity for this screen. More... | |
| void | setTransform (ScreenEntity *ent, Vector2 pos, Number angle) |
| Warps an entity to the specified location and angle. More... | |
| void | setVelocity (ScreenEntity *ent, Number fx, Number fy) |
| Sets the linear velocity of an entity. More... | |
| void | setVelocityX (ScreenEntity *ent, Number fx) |
| Sets the linear velocity of an entity on the X axis. More... | |
| void | setVelocityY (ScreenEntity *ent, Number fy) |
| Sets the linear velocity of an entity on the Y axis. More... | |
| void | setAngularVelocity (ScreenEntity *ent, Number spin) |
| Sets the angular velocity of an entity. More... | |
| Vector2 | getVelocity (ScreenEntity *ent) |
| Returns the velocity of an entity. More... | |
| void | wakeUp (ScreenEntity *ent) |
| Wake up a sleeping entity. More... | |
| ScreenEntity * | getEntityAtPosition (Number x, Number y) |
| Returns the entity at the specified position. More... | |
| bool | testEntityAtPosition (ScreenEntity *ent, Number x, Number y) |
| Returns true if the specified entity is at the specified position. More... | |
| bool | testEntityCollision (ScreenEntity *ent1, ScreenEntity *ent2) |
| Tests collision between two entities. | |
| PhysicsScreenEntity * | getPhysicsByScreenEntity (ScreenEntity *ent) |
| Returns the physics entity for the specified screen entity. More... | |
A 2D Physics enabled screen.
A PhysicsScreen acts like a normal screen, except that entities added to it with addPhysicsChild have physics automatically simulated. You can also use it to check collisions using addCollisionChild.
| PhysicsScreenEntity * PhysicsScreen::addCollisionChild | ( | ScreenEntity * | newEntity, |
| int | entType, | ||
| int | groupIndex = 0 , |
||
| bool | sensorOnly = true |
||
| ) |
Begins tracking collisions for a ScreenEntity and adds it to the scene.
| newEntity | Entity to track collisions for. |
| entType | Physics shape of the entity. Possible values are PhysicsScreenEntity::ENTITY_RECT or PhysicsScreenEntity::ENTITY_CIRCLE. |
| entityToRemove | Entity to remove from the screen. |
| PhysicsScreenEntity * PhysicsScreen::addPhysicsChild | ( | ScreenEntity * | newEntity, |
| int | entType, | ||
| bool | isStatic, | ||
| Number | friction = 0.1 , |
||
| Number | density = 1 , |
||
| Number | restitution = 0 , |
||
| bool | isSensor = false , |
||
| bool | fixedRotation = false , |
||
| int | groupIndex = 0 |
||
| ) |
Adds a ScreenEntity as a physics enabled child.
Once an entity is added as a physics child, its transforms are set by the physics engine and you are not able to position it manually. Use addCollisionChild/trackCollisionChild to track collisions of entities that you can position manually.
| newEntity | Screen entity to add. |
| entType | Physics entity type to add as. Possible values are PhysicsScreenEntity::ENTITY_RECT, PhysicsScreenEntity::ENTITY_CIRCLE and PhysicsScreenEntity::ENTITY_MESH. If the type is ENTITY_MESH, the ScreenEntity passed must be a ScreenMesh! |
| isStatic | If this parameter is true, the body is static (doesn't move on its own). |
| friction | Friction of the physics entity. Friction controls how entities drag along each other. |
| density | Density of the physics entity. Density controls how heavy the entity is. |
| restitution | Restitution of the physics entity. Restitution controls how bouncy the entity is. |
| isSensor | If this is set to true, the entity won't collide with other entities, but its collision will register. |
| fixedRotation | If this is set to true, the entity will always have a locked rotation. |
| groupIndex | is the physiscs shape's collision group. A negative number means objects of that group won't collide with eachother |
| void PhysicsScreen::applyForce | ( | ScreenEntity * | ent, |
| Number | fx, | ||
| Number | fy | ||
| ) |
Applies linear force to an entity.
| ent | Entity to apply force to. |
| fx | X value of the force direction vector. |
| fy | Y value of the force direction vector. |
| void PhysicsScreen::applyImpulse | ( | ScreenEntity * | ent, |
| Number | fx, | ||
| Number | fy | ||
| ) |
Applies an impulse to an entity.
| ent | Entity to apply force to. |
| fx | X value of the impulse direction vector. |
| fy | Y value of the impulse direction vector. |
| PhysicsJoint * PhysicsScreen::createDistanceJoint | ( | ScreenEntity * | ent1, |
| ScreenEntity * | ent2, | ||
| bool | collideConnected | ||
| ) |
Creates a new distance joint.
Distance joints keep the two entities at a fixed distance.
| ent1 | First entity to join. |
| ent2 | Second entity to join. |
| collideConnected | If set to true, both entities will collide with each other, if false, they will not. |
| PhysicsJoint * PhysicsScreen::createPrismaticJoint | ( | ScreenEntity * | ent1, |
| ScreenEntity * | ent2, | ||
| Vector2 | worldAxis, | ||
| Number | ax, | ||
| Number | ay, | ||
| bool | collideConnected = false , |
||
| Number | lowerTranslation = 0 , |
||
| Number | upperTranslation = 0 , |
||
| bool | enableLimit = false , |
||
| Number | motorSpeed = 0 , |
||
| Number | motorForce = 0 , |
||
| bool | motorEnabled = false |
||
| ) |
Creates a new prismatic joint.
Prismatic joints provide one degree of freedom between two entities.
| ent1 | First entity to join. |
| ent2 | Second entity to join. |
| collideConnected | If set to true, both entities will collide with each other, if false, they will not. |
| ax | Anchor point x (relative to first entity) |
| ay | Anchor point y (relative to first entity) |
| enableLimit | If true, the rotation will be limited to the specified values |
| lowerTranslation | If enableLimit is true, specifies the lower translation limit. |
| upperTranslation | If enableLimit is true, specifies the upper translation limit. |
| motorEnabled | If enabled, applies a constant motor to the rotation joint. |
| motorSpeed | If motorEnabled is true, controls the speed at which the motor rotates. |
| maxTorque | If motorEnabled is true, specifies the maximum force applied. |
| worldAxis | Specifies the relative world axis for the prismatic joint. |
| PhysicsJoint * PhysicsScreen::createRevoluteJoint | ( | ScreenEntity * | ent1, |
| ScreenEntity * | ent2, | ||
| Number | ax, | ||
| Number | ay, | ||
| bool | collideConnected = false , |
||
| bool | enableLimit = false , |
||
| Number | lowerLimit = 0 , |
||
| Number | upperLimit = 0 , |
||
| bool | motorEnabled = false , |
||
| Number | motorSpeed = 0 , |
||
| Number | maxTorque = 0 |
||
| ) |
Creates a new revolute joint.
Revolute joints enable one entity to rotate around a point on another entity.
| ent1 | Entity to anchor to. |
| ent2 | Entity to anchor. |
| ax | Anchor point x (relative to first entity) |
| ay | Anchor point y (relative to first entity) |
| enableLimit | If true, the rotation will be limited to the specified values |
| lowerLimit | If enableLimit is true, specifies the lower limit of the rotation in degrees. |
| upperLimit | If enableLimit is true, specifies the upper limit of the rotation in degrees. |
| motorEnabled | If enabled, applies a constant torque to the rotation joint. |
| motorSpeed | If motorEnabled is true, controls the speed at which the motor rotates. |
| maxTorque | If motorEnabled is true, specifies the maximum torque applied. |
| void PhysicsScreen::destroyJoint | ( | PhysicsJoint * | joint | ) |
Removes an existing joint.
| joint | Joint to remove. |
| ScreenEntity * PhysicsScreen::getEntityAtPosition | ( | Number | x, |
| Number | y | ||
| ) |
Returns the entity at the specified position.
| x | X position. |
| y | Y position. |
| PhysicsScreenEntity * PhysicsScreen::getPhysicsByScreenEntity | ( | ScreenEntity * | ent | ) |
Returns the physics entity for the specified screen entity.
When you add ScreenEntities to the physics screen, these physics entities are created to track the physics status of the screen entities. You don't need to deal with these ever, but if you want, you can get them anyway.
| ent | ScreenEntity instance to return the physics entity for. |
| Vector2 PhysicsScreen::getVelocity | ( | ScreenEntity * | ent | ) |
Returns the velocity of an entity.
| ent | Entity to return velocity for |
| void PhysicsScreen::removePhysicsChild | ( | ScreenEntity * | entityToRemove | ) |
Removes a physics child from the screen.
| entityToRemove | Entity to remove from the screen. |
| void PhysicsScreen::setAngularVelocity | ( | ScreenEntity * | ent, |
| Number | spin | ||
| ) |
Sets the angular velocity of an entity.
| ent | Entity to apply spin to. |
| spin | Spin value. |
| void PhysicsScreen::setGravity | ( | Vector2 | newGravity | ) |
Sets the gravity for this screen.
| newGravity | The new gravity vector. |
| void PhysicsScreen::setTransform | ( | ScreenEntity * | ent, |
| Vector2 | pos, | ||
| Number | angle | ||
| ) |
Warps an entity to the specified location and angle.
| ent | Entity to transform. |
| pos | New position to set. |
| angle | New angle to set. |
| void PhysicsScreen::setVelocity | ( | ScreenEntity * | ent, |
| Number | fx, | ||
| Number | fy | ||
| ) |
Sets the linear velocity of an entity.
| ent | Entity to set velocity to. |
| fx | X direction of velocity vector. |
| fy | Y direction of velocity vector. |
| void PhysicsScreen::setVelocityX | ( | ScreenEntity * | ent, |
| Number | fx | ||
| ) |
Sets the linear velocity of an entity on the X axis.
| ent | Entity to set velocity to. |
| fx | X direction of velocity vector. |
| void PhysicsScreen::setVelocityY | ( | ScreenEntity * | ent, |
| Number | fy | ||
| ) |
Sets the linear velocity of an entity on the Y axis.
| ent | Entity to set velocity to. |
| fy | Y direction of velocity vector. |
| void PhysicsScreen::stopTrackingChild | ( | ScreenEntity * | entity | ) |
Stops physics tracking for this entity but does not remove from screen.
| entity | Entity to stop tracking for. |
| bool PhysicsScreen::testEntityAtPosition | ( | ScreenEntity * | ent, |
| Number | x, | ||
| Number | y | ||
| ) |
Returns true if the specified entity is at the specified position.
| ent | Entity to test. |
| x | X position. |
| y | Y position. |
| PhysicsScreenEntity * PhysicsScreen::trackCollisionChild | ( | ScreenEntity * | newEntity, |
| int | entType, | ||
| int | groupIndex = 0 |
||
| ) |
Begins tracking collisions for a ScreenEntity.
| newEntity | Entity to track collisions for. |
| entType | Physics shape of the entity. Possible values are PhysicsScreenEntity::ENTITY_RECT or PhysicsScreenEntity::ENTITY_CIRCLE. |
| entityToRemove | Entity to remove from the screen. |
| PhysicsScreenEntity * PhysicsScreen::trackPhysicsChild | ( | ScreenEntity * | newEntity, |
| int | entType, | ||
| bool | isStatic, | ||
| Number | friction = 0.1 , |
||
| Number | density = 1 , |
||
| Number | restitution = 0 , |
||
| bool | isSensor = false , |
||
| bool | fixedRotation = false , |
||
| int | groupIndex = 0 |
||
| ) |
Tracks a ScreenEntity as a physics enabled child.
Once an entity is added as a physics child, its transforms are set by the physics engine and you are not able to position it manually. Use addCollisionChild/trackCollisionChild to track collisions of entities that you can position manually.
| newEntity | Screen entity to add. |
| entType | Physics entity type to add as. Possible values are PhysicsScreenEntity::ENTITY_RECT, PhysicsScreenEntity::ENTITY_CIRCLE and PhysicsScreenEntity::ENTITY_MESH. If the type is ENTITY_MESH, the ScreenEntity passed must be a ScreenMesh! |
| isStatic | If this parameter is true, the body is static (doesn't move on its own). |
| friction | Friction of the physics entity. Friction controls how entities drag along each other. |
| density | Density of the physics entity. Density controls how heavy the entity is. |
| restitution | Restitution of the physics entity. Restitution controls how bouncy the entity is. |
| isSensor | If this is set to true, the entity won't collide with other entities, but its collision will register. |
| fixedRotation | If this is set to true, the entity will always have a locked rotation. |
| groupIndex | is the physiscs shape's collision group. A negative number means objects of that group won't collide with eachother |
| void PhysicsScreen::wakeUp | ( | ScreenEntity * | ent | ) |
Wake up a sleeping entity.
The physics engine puts non-moving entities to sleep automatically. Use this to wake them up.
| ent | Entity to wake up. |


This function creates a connection to a remote server
This function creates a connection to a remote server
returns a const char * to a string like "1.1 178d78c" representing the library version followed by the git head hash it was built from
This function creates the listening socket (if serving) and takes care of all initialization in one step.After initialization, it returns a struct libwebsocket_context * that represents this server. After calling, user code needs to take care of calling libwebsocket_service with the context pointer to get the server's sockets serviced. This must be done in the same process context as the initialization call.
The protocol callback functions are called for a handful of events including http requests coming in, websocket connections becoming established, and data arriving; it's also called periodically to allow async transmission.
HTTP requests are sent always to the FIRST protocol in protocol, since at that time websocket protocol has not been negotiated. Other protocols after the first one never see any HTTP callack activity.
The server created is a simple http server by default; part of the websocket standard is upgrading this http connection to a websocket one.
This allows the same server to provide files like scripts and favicon / images or whatever over http and dynamic data over websockets all in one place; they're all handled in the user callback.
This function closes any active connections and then frees the context. After calling this, any further use of the context is undefined.
This function fills in name and rip with the name and IP of the client connected with socket descriptor fd. Names may be truncated if there is not enough room. If either cannot be determined, they will be returned as valid zero-length strings.
This returns the optional user allocation that can be attached to the context the sockets live in at context_create time. It's a way to let all sockets serviced in the same context share data without using globals statics in the user code.
You will not need this unless you are doing something special
You will not need this unless you are doing something special
If the output side of a server process becomes choked, this allows flow control for the input side.
When the user server code realizes it can accept more input, it can call this to have the RX flow restriction removed from all connections using the given protocol.
This is typically used by client code to fill in the host parameter when making a client connection. You can only call it after the context has been created.
Returns 0 if proxy string was parsed and proxy was setup. Returns -1 if proxy is NULL or has incorrect format.This is only required if your OS does not provide the http_proxy enviroment variable (eg, OSX)
IMPORTANT! You should call this function right after creation of the libwebsocket_context and before call to connect. If you call this function after connect behavior is undefined. This function will override proxy settings made on libwebsocket_context creation with genenv call.
Some apis can act on all live connections of a given protocol, this is how you can get a pointer to the active protocol if needed.
log level defaults to "err", "warn" and "notice" contexts enabled and emission on stderr.
Returns 0 if the connection is not using SSL, 1 if using SSL and using verified cert, and 2 if using SSL but the cert was not checked (appears for client wsi told to skip check on connection)
Returns 1 if you cannot use libwebsocket_write because the last write on this connection is still buffered, and can't be cleared without returning to the service loop and waiting for the connection to be writeable again.If you will try to do >1 libwebsocket_write call inside a single WRITEABLE callback, you must check this after every write and bail if set, ask for a new writeable callback and continue writing from there.
This is never set at the start of a writeable callback, but any write may set it.
This function let a call to libwebsocket_service waiting for a timeout immediately return.
This function let a call to libwebsocket_service waiting for a timeout immediately return.
This function provides the way to issue data back to the client for both http and websocket protocols.In the case of sending using websocket protocol, be sure to allocate valid storage before and after buf as explained above. This scheme allows maximum efficiency of sending data and protocol in a single packet while not burdening the user code with any protocol knowledge.
Return may be -1 for a fatal error needing connection close, or a positive number reflecting the amount of bytes actually sent. This can be less than the requested number of bytes due to OS memory pressure at any given time.
This is intended to be called from the LWS_CALLBACK_RECEIVE callback if it's interested to see if the frame it's dealing with was sent in binary mode.
This function is intended to be called from the callback if the user code is interested in "complete packets" from the client. libwebsockets just passes through payload as it comes and issues a buffer additionally when it hits a built-in limit. The LWS_CALLBACK_RECEIVE callback handler can use this API to find out if the buffer it has just been given is the last piece of a "complete packet" from the client -- when that is the case libwebsockets_remaining_packet_payload will return 0.Many protocols won't care becuse their packets are always small.
Helper to report HTTP errors back to the client cleanly and consistently
This function is intended to be called from the callback in response to http requests from the client. It allows the callback to issue local files down the http link in a single step.Returning <0 indicates error and the wsi should be closed. Returning >0 indicates the file was completely sent and the wsi should be closed. ==0 indicates the file transfer is started and needs more service later, the wsi should be left alone.
This function takes a pollfd that has POLLIN or POLLOUT activity and services it according to the state of the associated struct libwebsocket.The one call deals with all "service" that might happen on a socket including listen accepts, http files as well as websocket protocol.
If a pollfd says it has something, you can just pass it to libwebsocket_serice_fd whether it is a socket handled by lws or not. If it sees it is a lws socket, the traffic will be handled and pollfd->revents will be zeroed now.
If the socket is foreign to lws, it leaves revents alone. So you can see if you should service yourself by checking the pollfd revents after letting lws try to service it.
This function deals with any pending websocket traffic, for three kinds of event. It handles these events on both server and client types of connection the same.1) Accept new connections to our context's server
2) Call the receive callback for incoming frame data received by server or client connections.
You need to call this service function periodically to all the above functions to happen; if your application is single-threaded you can just call it in your main event loop.
Alternatively you can fork a new process that asynchronously handles calling this service in a loop. In that case you are happy if this call blocks your thread until it needs to take care of something and would call it with a large nonzero timeout. Your loop then takes no CPU while there is nothing happening.
If you are calling it in a single-threaded app, you don't want it to wait around blocking other things in your loop from happening, so you would call it with a timeout_ms of 0, so it returns immediately if nothing is pending, or as soon as it services whatever was pending.
This callback is the way the user controls what is served. All the protocol detail is hidden and handled by the library.For each connection / session there is user data allocated that is pointed to by "user". You set the size of this user data area when the library is initialized with libwebsocket_create_server.
You get an opportunity to initialize user data when called back with LWS_CALLBACK_ESTABLISHED reason.
after the server completes a handshake with an incoming client
the request client connection has been unable to complete a handshake with the remote server
this is the last chance for the client user code to examine the http headers and decide to reject the connection. If the content in the headers is interesting to the client (url, etc) it needs to copy it out at this point since it will be destroyed before the CLIENT_ESTABLISHED call
after your client connection completed a handshake with the remote server
when the websocket session ends
when a HTTP (non-websocket) session ends
data has appeared for this server endpoint from a remote client, it can be found at *in and is len bytes long
if you elected to see PONG packets, they appear with this callback reason. PONG packets only exist in 04+ protocol
data has appeared from the server for the client connection, it can be found at *in and is len bytes long
an http request has come from a client that is not asking to upgrade the connection to a websocket one. This is a chance to serve http content, for example, to send a script to the client which will then open the websockets connection. in points to the URI path requested and libwebsockets_serve_http_file makes it very simple to send back a file to the client. Normally after sending the file you are done with the http connection, since the rest of the activity will come by websockets from the script that was delivered by http, so you will want to return 1; to close and free up the connection. That's important because it uses a slot in the total number of client connections allowed set by MAX_CLIENTS.
the next len bytes data from the http request body HTTP connection is now available in in.
the expected amount of http request body has been delivered
you can write more down the http protocol link now.
a file requested to be send down http link has completed.
If you call libwebsocket_callback_on_writable on a connection, you will get one of these callbacks coming when the connection socket is able to accept another write packet without blocking. If it already was able to take another packet without blocking, you'll get this callback at the next call to the service loop function. Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE and servers get LWS_CALLBACK_SERVER_WRITEABLE.
called when a client connects to the server at network level; the connection is accepted but then passed to this callback to decide whether to hang up immediately or not, based on the client IP. in contains the connection socket's descriptor. Since the client connection information is not available yet, wsi still pointing to the main server socket. Return non-zero to terminate the connection before sending or receiving anything. Because this happens immediately after the network connection from the client, there's no websocket protocol selected yet so this callback is issued only to protocol 0.
A new client just had been connected, accepted, and instantiated into the pool. This callback allows setting any relevant property to it. Because this happens immediately after the instantiation of a new client, there's no websocket protocol selected yet so this callback is issued only to protocol 0. Only wsi is defined, pointing to the new client, and the return value is ignored.
called when the request has been received and parsed from the client, but the response is not sent yet. Return non-zero to disallow the connection. user is a pointer to the connection user space allocation, in is the URI, eg, "/" In your handler you can use the public APIs lws_hdr_total_length / lws_hdr_copy to access all of the headers using the header enums lws_token_indexes from libwebsockets.h to check for and read the supported header presence and content before deciding to allow the http connection to proceed or to kill the connection.
called when the handshake has been received and parsed from the client, but the response is not sent yet. Return non-zero to disallow the connection. user is a pointer to the connection user space allocation, in is the requested protocol name In your handler you can use the public APIs lws_hdr_total_length / lws_hdr_copy to access all of the headers using the header enums lws_token_indexes from libwebsockets.h to check for and read the supported header presence and content before deciding to allow the handshake to proceed or to kill the connection.
if configured for including OpenSSL support, this callback allows your user code to perform extra SSL_CTX_load_verify_locations or similar calls to direct OpenSSL where to find certificates the client can use to confirm the remote server identity. user is the OpenSSL SSL_CTX*
if configured for including OpenSSL support, this callback allows your user code to load extra certifcates into the server which allow it to verify the validity of certificates returned by clients. user is the server's OpenSSL SSL_CTX*
if the libwebsockets context was created with the option LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this callback is generated during OpenSSL verification of the cert sent from the client. It is sent to protocol[0] callback as no protocol has been negotiated on the connection yet. Notice that the libwebsockets context and wsi are both NULL during this callback. See
//www.openssl.org/docs/ssl/SSL_CTX_set_verify.html to understand more detail about the OpenSSL callback that generates this libwebsockets callback and the meanings of the arguments passed. In this callback, user is the x509_ctx, in is the ssl pointer and len is preverify_ok Notice that this callback maintains libwebsocket return conventions, return 0 to mean the cert is OK or 1 to fail it. This also means that if you don't handle this callback then the default callback action of returning 0 allows the client certificates.
this callback happens when a client handshake is being compiled. user is NULL, in is a char **, it's pointing to a char * which holds the next location in the header buffer where you can add headers, and len is the remaining space in the header buffer, which is typically some hundreds of bytes. So, to add a canned cookie, your handler code might look similar to:char **p = (char **)in;
if (len < 100) return 1;
*p += sprintf(*p, "Cookie: a=b\x0d\x0a");
return 0;
Notice if you add anything, you just have to take care about the CRLF on the line you added. Obviously this callback is optional, if you don't handle it everything is fine.
Notice the callback is coming to protocols[0] all the time, because there is no specific protocol handshook yet.
When the server handshake code sees that it does support a requested extension, before accepting the extension by additing to the list sent back to the client it gives this callback just to check that it's okay to use that extension. It calls back to the requested protocol and with in being the extension name, len is 0 and user is valid. Note though at this time the ESTABLISHED callback hasn't happened yet so if you initialize user content there, user content during this callback might not be useful for anything. Notice this callback comes to protocols[0].
When a client connection is being prepared to start a handshake to a server, each supported extension is checked with protocols[0] callback with this reason, giving the user code a chance to suppress the claim to support that extension by returning non-zero. If unhandled, by default 0 will be returned and the extension support included in the header to the server. Notice this callback comes to protocols[0].
One-time call per protocol so it can do initial setup / allocations etc
One-time call per protocol indicating this protocol won't get used at all after this callback, the context is getting destroyed. Take the opportunity to deallocate everything that was allocated by the protocol.
outermost (earliest) wsi create notification
outermost (latest) wsi destroy notificationThe next five reasons are optional and only need taking care of if you will be integrating libwebsockets sockets into an external polling array.
For these calls, in points to a struct libwebsocket_pollargs that contains fd, events and prev_events members
libwebsocket deals with its poll loop internally, but in the case you are integrating with another server you will need to have libwebsocket sockets share a polling array with the other server. This and the other POLL_FD related callbacks let you put your specialized poll array interface code in the callback for protocol 0, the first protocol you support, usually the HTTP protocol in the serving case. This callback happens when a socket needs to be
in points to a struct libwebsocket_pollargs; the fd member of the struct is the file descriptor, and events contains the active events.If you are using the internal polling loop (the "service" callback), you can just ignore these callbacks.
This callback happens when a socket descriptor needs to be removed from an external polling array. in is again the struct libwebsocket_pollargs containing the fd member to be removed. If you are using the internal polling loop, you can just ignore it.
This callback happens when libwebsockets wants to modify the events for a connectiion. in is the struct libwebsocket_pollargs with the fd to change. The new event mask is in events member and the old mask is in the prev_events member. If you are using the internal polling loop, you can just ignore it.
These allow the external poll changes driven by libwebsockets to participate in an external thread locking scheme around the changes, so the whole thing is threadsafe.
Each extension that is active on a particular connection receives callbacks during the connection lifetime to allow the extension to operate on websocket data and manage itself.Libwebsockets takes care of allocating and freeing "user" memory for each active extension on each connection. That is what is pointed to by the user parameter.
called when the server has decided to select this extension from the list provided by the client, just before the server will send back the handshake accepting the connection with this extension active. This gives the extension a chance to initialize its connection context found in user.
same as LWS_EXT_CALLBACK_CONSTRUCT but called when client is instantiating this extension. Some extensions will work the same on client and server side and then you can just merge handlers for both CONSTRUCTS.
called when the connection the extension was being used on is about to be closed and deallocated. It's the last chance for the extension to deallocate anything it has allocated in the user data (pointed to by user) before the user data is deleted. This same callback is used whether you are in client or server instantiation context.
when this extension was active on a connection, and a packet of data arrived at the connection, it is passed to this callback to give the extension a chance to change the data, eg, decompress it. user is pointing to the extension's private connection context data, in is pointing to an lws_tokens struct, it consists of a char * pointer called token, and an int called token_len. At entry, these are set to point to the received buffer and set to the content length. If the extension will grow the content, it should use a new buffer allocated in its private user context data and set the pointed-to lws_tokens members to point to its buffer.
this works the same way as LWS_EXT_CALLBACK_PACKET_RX_PREPARSE above, except it gives the extension a chance to change websocket data just before it will be sent out. Using the same lws_token pointer scheme in in, the extension can change the buffer and the length to be transmitted how it likes. Again if it wants to grow the buffer safely, it should copy the data into its own buffer and set the lws_tokens token pointer to it.
This structure represents one protocol supported by the server. An array of these structures is passed to libwebsocket_create_server allows as many protocols as you like to be handled by one server.The first protocol given has its callback used for user callbacks when there is no agreed protocol name, that's true during HTTP part of the
header.


|
Panda3D
|
A single channel of communication from an HTTPClient. More...
Public Types | |
| enum | StatusCode { SC_incomplete = 0, SC_internal_error = 1, SC_no_connection = 2, SC_timeout = 3, SC_lost_connection = 4, SC_non_http_response = 5, SC_invalid_http = 6, SC_socks_invalid_version = 7, SC_socks_no_acceptable_login_method = 8, SC_socks_refused = 9, SC_socks_no_connection = 10, SC_ssl_internal_failure = 11, SC_ssl_no_handshake = 12, SC_http_error_watermark = 13, SC_ssl_invalid_server_certificate = 14, SC_ssl_self_signed_server_certificate = 15, SC_ssl_unexpected_server = 16, SC_download_open_error = 17, SC_download_write_error = 18, SC_download_invalid_range = 19 } |
Public Member Functions | |
| __init__ (const HTTPChannel) | |
| beginConnectTo (const DocumentSpec url) | |
| Begins a non-blocking request to establish a direct connection to the server and port indicated by the URL. More... | |
| beginGetDocument (const DocumentSpec url) | |
| Begins a non-blocking request to retrieve a given document. More... | |
| beginGetHeader (const DocumentSpec url) | |
| Begins a non-blocking request to retrieve a given header. More... | |
| beginGetSubdocument (const DocumentSpec url, int first_byte, int last_byte) | |
| Begins a non-blocking request to retrieve only the specified byte range of the indicated document. More... | |
| beginPostForm (const DocumentSpec url, str body) | |
| Posts form data to a particular URL and retrieves the response, all using non-blocking I/O. More... | |
| clearExtraHeaders () | |
| Resets the extra headers that were previously added via calls to send_extra_header(). More... | |
| closeReadBody (Istream stream) | |
| Closes a file opened by a previous call to open_read_body(). More... | |
| bool | connectTo (const DocumentSpec url) |
| Establish a direct connection to the server and port indicated by the URL, but do not issue any HTTP requests. More... | |
| bool | deleteDocument (const DocumentSpec url) |
| Requests the server to remove the indicated URL. More... | |
| bool | downloadToFile (const Filename filename, bool subdocument_resumes) |
| Specifies the name of a file to download the resulting document to. More... | |
| bool | downloadToRam (Ramfile ramfile, bool subdocument_resumes) |
| Specifies a Ramfile object to download the resulting document to. More... | |
| bool | downloadToStream (Ostream strm, bool subdocument_resumes) |
| Specifies the name of an ostream to download the resulting document to. More... | |
| bool | getAllowProxy () |
| If this is true (the normal case), the HTTPClient will be consulted for information about the proxy to be used for each connection via this HTTPChannel. More... | |
| bool | getBlockingConnect () |
| If this flag is true, a socket connect will block even for nonblocking I/O calls like begin_get_document(), begin_connect_to(), etc. More... | |
| int | getBytesDownloaded () |
| Returns the number of bytes downloaded during the last (or current) download_to_file() or download_to_ram operation(). More... | |
| int | getBytesRequested () |
| When download throttling is in effect (set_download_throttle() has been set to true) and non-blocking I/O methods (like begin_get_document()) are used, this returns the number of bytes "requested" from the server so far: that is, the theoretical maximum value for get_bytes_downloaded(), if the server has been keeping up with our demand. More... | |
| HTTPClient | getClient () |
| Returns the HTTPClient object that owns this channel. More... | |
| SocketStream | getConnection () |
| Returns the connection that was established via a previous call to connect_to() or begin_connect_to(), or NULL if the connection attempt failed or if those methods have not recently been called. More... | |
| double | getConnectTimeout () |
| Returns the length of time, in seconds, to wait for a new nonblocking socket to connect. More... | |
| str | getContentType () |
| Returns the value of the Content-Type header. More... | |
| bool | getDocument (const DocumentSpec url) |
| Opens the named document for reading, if available. More... | |
| const DocumentSpec | getDocumentSpec () |
| Returns the DocumentSpec associated with the most recent document. More... | |
| bool | getDownloadThrottle () |
| Returns whether the nonblocking downloads will be bandwidth-limited. More... | |
| Streamsize | getFileSize () |
| Returns the size of the file, if it is known. More... | |
| int | getFirstByteDelivered () |
| Returns the first byte of the file (that will be) delivered by the server in response to the current request. More... | |
| int | getFirstByteRequested () |
| Returns the first byte of the file requested by the request. More... | |
| bool | getHeader (const DocumentSpec url) |
| Like get_document(), except only the header associated with the document is retrieved. More... | |
| str | getHeaderValue (str key) |
| Returns the HTML header value associated with the indicated key, or empty string if the key was not defined in the message returned by the server. More... | |
| double | getHttpTimeout () |
| Returns the length of time, in seconds, to wait for the HTTP server to respond to our request. More... | |
| HTTPEnum::HTTPVersion | getHttpVersion () |
| Returns the HTTP version number returned by the server, as one of the HTTPClient enumerated types, e.g. More... | |
| str | getHttpVersionString () |
| Returns the HTTP version number returned by the server, formatted as a string, e.g. More... | |
| double | getIdleTimeout () |
| Returns the amount of time, in seconds, in which an previously-established connection is allowed to remain open and unused. More... | |
| int | getLastByteDelivered () |
| Returns the last byte of the file (that will be) delivered by the server in response to the current request. More... | |
| int | getLastByteRequested () |
| Returns the last byte of the file requested by the request. More... | |
| double | getMaxBytesPerSecond () |
| Returns the maximum number of bytes per second that may be consumed by this channel when get_download_throttle() is true. More... | |
| double | getMaxUpdatesPerSecond () |
| Returns the maximum number of times per second that run() will do anything at all, when get_download_throttle() is true. More... | |
| int | getNumRedirectSteps () |
| If the document automatically followed one or more redirects, this will return the number of redirects that were automatically followed. More... | |
| bool | getOptions (const DocumentSpec url) |
| Sends an OPTIONS message to the server, which should query the available options, possibly in relation to a specified URL. More... | |
| bool | getPersistentConnection () |
| Returns whether the HTTPChannel should try to keep the connection to the server open and reuse that connection for multiple documents, or whether it should close the connection and open a new one for each request. More... | |
| str | getProxyRealm () |
| If the document failed to connect because of a 407 (Proxy authorization required), this method will return the "realm" returned by the proxy. More... | |
| bool | getProxyTunnel () |
| Returns true if connections always tunnel through a proxy, or false (the normal case) if we allow the proxy to serve up documents. More... | |
| const URLSpec | getRedirect () |
| If the document failed with a redirect code (300 series), this will generally contain the new URL the server wants us to try. More... | |
| const URLSpec | getRedirectStep (int n) |
| Use in conjunction with get_num_redirect_steps() to extract the chain of URL's that the channel was automatically redirected through to arrive at the final document. More... | |
| list | getRedirectSteps () |
| int | getSkipBodySize () |
| Returns the maximum number of bytes in a received (but unwanted) body that will be skipped past, in order to reset to a new request. More... | |
| int | getStatusCode () |
| Returns the HTML return code from the document retrieval request. More... | |
| str | getStatusString () |
| Returns the string as returned by the server describing the status code for humans. More... | |
| bool | getSubdocument (const DocumentSpec url, int first_byte, int last_byte) |
| Retrieves only the specified byte range of the indicated document. More... | |
| bool | getTrace (const DocumentSpec url) |
| Sends a TRACE message to the server, which should return back the same message as the server received it, allowing inspection of proxy hops, etc. More... | |
| const URLSpec | getUrl () |
| Returns the URL that was used to retrieve the most recent document: whatever URL was last passed to get_document() or get_header(). More... | |
| str | getWwwRealm () |
| If the document failed to connect because of a 401 (Authorization required), this method will return the "realm" returned by the server in which the requested document must be authenticated. More... | |
| bool | isConnectionReady () |
| Returns true if a connection has been established to the named server in a previous call to connect_to() or begin_connect_to(), false otherwise. More... | |
| bool | isDownloadComplete () |
| Returns true when a download_to() or download_to_ram() has executed and the file has been fully downloaded. More... | |
| bool | isFileSizeKnown () |
| Returns true if the size of the file we are currently retrieving was told us by the server and thus is reliably known, or false if the size reported by get_file_size() represents an educated guess (possibly as set by set_expected_file_size(), or as inferred from a chunked transfer encoding in progress). More... | |
| bool | isValid () |
| Returns true if the last-requested document was successfully retrieved and is ready to be read, false otherwise. More... | |
| ISocketStream | openReadBody () |
| Returns a newly-allocated istream suitable for reading the body of the document. More... | |
| bool | postForm (const DocumentSpec url, str body) |
| Posts form data to a particular URL and retrieves the response. More... | |
| preserveStatus () | |
| Preserves the previous status code (presumably a failure) from the previous connection attempt. More... | |
| bool | putDocument (const DocumentSpec url, str body) |
| Uploads the indicated body to the server to replace the indicated URL, if the server allows this. More... | |
| reset () | |
| Stops whatever file transaction is currently in progress, closes the connection, and resets to begin anew. More... | |
| bool | run () |
| This must be called from time to time when non-blocking I/O is in use. More... | |
| sendExtraHeader (str key, str value) | |
| Specifies an additional key: value pair that is added into the header sent to the server with the next request. More... | |
| setAllowProxy (bool allow_proxy) | |
| If this is true (the normal case), the HTTPClient will be consulted for information about the proxy to be used for each connection via this HTTPChannel. More... | |
| setBlockingConnect (bool blocking_connect) | |
| If this flag is true, a socket connect will block even for nonblocking I/O calls like begin_get_document(), begin_connect_to(), etc. More... | |
| setConnectTimeout (double timeout_seconds) | |
| Sets the maximum length of time, in seconds, that the channel will wait before giving up on establishing a TCP connection. More... | |
| setContentType (str content_type) | |
| Specifies the Content-Type header, useful for applications that require different types of content, such as JSON. More... | |
| setDownloadThrottle (bool download_throttle) | |
| Specifies whether nonblocking downloads (via download_to_file() or download_to_ram()) will be limited so as not to use all available bandwidth. More... | |
| setExpectedFileSize (int file_size) | |
| This may be called immediately after a call to get_document() or some related function to specify the expected size of the document we are retrieving, if we happen to know. More... | |
| setHttpTimeout (double timeout_seconds) | |
| Sets the maximum length of time, in seconds, that the channel will wait for the HTTP server to finish sending its response to our request. More... | |
| setIdleTimeout (double idle_timeout) | |
| Specifies the amount of time, in seconds, in which a previously-established connection is allowed to remain open and unused. More... | |
| setMaxBytesPerSecond (double max_bytes_per_second) | |
| When bandwidth throttling is in effect (see set_download_throttle()), this specifies the maximum number of bytes per second that may be consumed by this channel. More... | |
| setMaxUpdatesPerSecond (double max_updates_per_second) | |
| When bandwidth throttling is in effect (see set_download_throttle()), this specifies the maximum number of times per second that run() will attempt to do any downloading at all. More... | |
| setPersistentConnection (bool persistent_connection) | |
| Indicates whether the HTTPChannel should try to keep the connection to the server open and reuse that connection for multiple documents, or whether it should close the connection and open a new one for each request. More... | |
| setProxyTunnel (bool proxy_tunnel) | |
| Normally, a proxy is itself asked for ordinary URL's, and the proxy decides whether to hand the client a cached version of the document or to contact the server for a fresh version. More... | |
| setSkipBodySize (int skip_body_size) | |
| Specifies the maximum number of bytes in a received (but unwanted) body that will be skipped past, in order to reset to a new request. More... | |
| bool | willCloseConnection () |
| Returns true if the server has indicated it will close the connection after this document has been read, or false if it will remain open (and future documents may be requested on the same connection). More... | |
| writeHeaders (Ostream out) | |
| Outputs a list of all headers defined by the server to the indicated output stream. More... | |
| Public Member Functions inherited from TypedObject | |
| TypeHandle | getType () |
| int | getTypeIndex () |
| Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
| bool | isExactType (TypeHandle handle) |
| Returns true if the current object is the indicated type exactly. More... | |
| bool | isOfType (TypeHandle handle) |
| Returns true if the current object is or derives from the indicated type. More... | |
| Public Member Functions inherited from ReferenceCount | |
| int | getRefCount () |
| Returns the current reference count. More... | |
| ref () | |
| Explicitly increments the reference count. More... | |
| bool | testRefCountIntegrity () |
| Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
| bool | testRefCountNonzero () |
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
| bool | unref () |
| Explicitly decrements the reference count. More... | |
Static Public Member Functions | |
| static TypeHandle | getClassType () |
| Static Public Member Functions inherited from TypedReferenceCount | |
| static TypeHandle | getClassType () |
| Static Public Member Functions inherited from TypedObject | |
| static TypeHandle | getClassType () |
| Static Public Member Functions inherited from ReferenceCount | |
| static TypeHandle | getClassType () |
Additional Inherited Members | |
| Public Attributes inherited from TypedObject | |
| TypeHandle | type |
| Returns the TypeHandle representing this object's type. More... | |
| Public Attributes inherited from ReferenceCount | |
| int | ref_count |
| The current reference count. More... | |
A single channel of communication from an HTTPClient.
This is similar to the concept of a 'connection', except that HTTP is technically connectionless; in fact, a channel may represent one unbroken connection or it may transparently close and reopen a new connection with each request.
A channel is conceptually a single thread of I/O. One document at a time may be requested using a channel; a new document may (in general) not be requested from the same HTTPChannel until the first document has been fully retrieved.
| enum StatusCode |
| __init__ | ( | const | HTTPChannel | ) |
| beginConnectTo | ( | const DocumentSpec | url | ) |
Begins a non-blocking request to establish a direct connection to the server and port indicated by the URL.
No HTTP requests will be issued beyond what is necessary to establish the connection. When run() has finished, you may call is_connection_ready() to determine if the connection was successfully established.
If successful, the connection may then be taken to use for whatever purposes you like by calling get_connection().
This establishes a nonblocking I/O socket. Also see connect_to().
| beginGetDocument | ( | const DocumentSpec | url | ) |
Begins a non-blocking request to retrieve a given document.
This method will return immediately, even before a connection to the server has necessarily been established; you must then call run() from time to time until the return value of run() is false. Then you may check is_valid() and get_status_code() to determine the status of your request.
If a previous request had been pending, that request is discarded.
| beginGetHeader | ( | const DocumentSpec | url | ) |
Begins a non-blocking request to retrieve a given header.
See begin_get_document() and get_header().
| beginGetSubdocument | ( | const DocumentSpec | url, |
| int | first_byte, | ||
| int | last_byte | ||
| ) |
Begins a non-blocking request to retrieve only the specified byte range of the indicated document.
If last_byte is 0, it stands for the last byte of the document. When a subdocument is requested, get_file_size() and get_bytes_downloaded() will report the number of bytes of the subdocument, not of the complete document.
| beginPostForm | ( | const DocumentSpec | url, |
| str | body | ||
| ) |
Posts form data to a particular URL and retrieves the response, all using non-blocking I/O.
See begin_get_document() and post_form().
It is important to note that you must call run() repeatedly after calling this method until run() returns false, and you may not call any other document posting or retrieving methods using the HTTPChannel object in the interim, or your form data may not get posted.
| clearExtraHeaders | ( | ) |
Resets the extra headers that were previously added via calls to send_extra_header().
| closeReadBody | ( | Istream | stream | ) |
Closes a file opened by a previous call to open_read_body().
This really just deletes the istream pointer, but it is recommended to use this interface instead of deleting it explicitly, to help work around compiler issues.
| bool connectTo | ( | const DocumentSpec | url | ) |
Establish a direct connection to the server and port indicated by the URL, but do not issue any HTTP requests.
If successful, the connection may then be taken to use for whatever purposes you like by calling get_connection().
This establishes a blocking I/O socket. Also see begin_connect_to().
| bool deleteDocument | ( | const DocumentSpec | url | ) |
Requests the server to remove the indicated URL.
| bool downloadToFile | ( | const Filename | filename, |
| bool | subdocument_resumes | ||
| ) |
Specifies the name of a file to download the resulting document to.
This should be called immediately after get_document() or begin_get_document() or related functions.
In the case of the blocking I/O methods like get_document(), this function will download the entire document to the file and return true if it was successfully downloaded, false otherwise.
In the case of non-blocking I/O methods like begin_get_document(), this function simply indicates an intention to download to the indicated file. It returns true if the file can be opened for writing, false otherwise, but the contents will not be completely downloaded until run() has returned false. At this time, it is possible that a communications error will have left a partial file, so is_download_complete() may be called to test this.
If subdocument_resumes is true and the document in question was previously requested as a subdocument (i.e. get_subdocument() with a first_byte value greater than zero), this will automatically seek to the appropriate byte within the file for writing the output. In this case, the file must already exist and must have at least first_byte bytes in it. If subdocument_resumes is false, a subdocument will always be downloaded beginning at the first byte of the file.
| bool downloadToRam | ( | Ramfile | ramfile, |
| bool | subdocument_resumes | ||
| ) |
Specifies a Ramfile object to download the resulting document to.
This should be called immediately after get_document() or begin_get_document() or related functions.
In the case of the blocking I/O methods like get_document(), this function will download the entire document to the Ramfile and return true if it was successfully downloaded, false otherwise.
In the case of non-blocking I/O methods like begin_get_document(), this function simply indicates an intention to download to the indicated Ramfile. It returns true if the file can be opened for writing, false otherwise, but the contents will not be completely downloaded until run() has returned false. At this time, it is possible that a communications error will have left a partial file, so is_download_complete() may be called to test this.
If subdocument_resumes is true and the document in question was previously requested as a subdocument (i.e. get_subdocument() with a first_byte value greater than zero), this will automatically seek to the appropriate byte within the Ramfile for writing the output. In this case, the Ramfile must already have at least first_byte bytes in it.
| bool downloadToStream | ( | Ostream | strm, |
| bool | subdocument_resumes | ||
| ) |
Specifies the name of an ostream to download the resulting document to.
This should be called immediately after get_document() or begin_get_document() or related functions.
In the case of the blocking I/O methods like get_document(), this function will download the entire document to the file and return true if it was successfully downloaded, false otherwise.
In the case of non-blocking I/O methods like begin_get_document(), this function simply indicates an intention to download to the indicated file. It returns true if the file can be opened for writing, false otherwise, but the contents will not be completely downloaded until run() has returned false. At this time, it is possible that a communications error will have left a partial file, so is_download_complete() may be called to test this.
If subdocument_resumes is true and the document in question was previously requested as a subdocument (i.e. get_subdocument() with a first_byte value greater than zero), this will automatically seek to the appropriate byte within the file for writing the output. In this case, the file must already exist and must have at least first_byte bytes in it. If subdocument_resumes is false, a subdocument will always be downloaded beginning at the first byte of the file.
| bool getAllowProxy | ( | ) |
If this is true (the normal case), the HTTPClient will be consulted for information about the proxy to be used for each connection via this HTTPChannel.
If this has been set to false by the user, then all connections will be made directly, regardless of the proxy settings indicated on the HTTPClient.
| bool getBlockingConnect | ( | ) |
If this flag is true, a socket connect will block even for nonblocking I/O calls like begin_get_document(), begin_connect_to(), etc.
If false, a socket connect will not block for nonblocking I/O calls, but will block for blocking I/O calls (get_document(), connect_to(), etc.).
| int getBytesDownloaded | ( | ) |
Returns the number of bytes downloaded during the last (or current) download_to_file() or download_to_ram operation().
This can be used in conjunction with get_file_size() to report the percent complete (but be careful, since get_file_size() may return 0 if the server has not told us the size of the file).
| int getBytesRequested | ( | ) |
When download throttling is in effect (set_download_throttle() has been set to true) and non-blocking I/O methods (like begin_get_document()) are used, this returns the number of bytes "requested" from the server so far: that is, the theoretical maximum value for get_bytes_downloaded(), if the server has been keeping up with our demand.
If this number is less than get_bytes_downloaded(), then the server has not been supplying bytes fast enough to meet our own download throttle rate.
When download throttling is not in effect, or when the blocking I/O methods (like get_document(), etc.) are used, this returns 0.
|
static |
| HTTPClient getClient | ( | ) |
Returns the HTTPClient object that owns this channel.
| SocketStream getConnection | ( | ) |
Returns the connection that was established via a previous call to connect_to() or begin_connect_to(), or NULL if the connection attempt failed or if those methods have not recently been called.
This stream has been allocated from the free store. It is the user's responsibility to delete this pointer when finished with it.
| double getConnectTimeout | ( | ) |
Returns the length of time, in seconds, to wait for a new nonblocking socket to connect.
See set_connect_timeout().
| str getContentType | ( | ) |
Returns the value of the Content-Type header.
| bool getDocument | ( | const DocumentSpec | url | ) |
Opens the named document for reading, if available.
Returns true if successful, false otherwise.
| const DocumentSpec getDocumentSpec | ( | ) |
Returns the DocumentSpec associated with the most recent document.
This includes its actual URL (following redirects) along with the identity tag and last-modified date, if supplied by the server.
This structure may be saved and used to retrieve the same version of the document later, or to conditionally retrieve a newer version if it is available.
| bool getDownloadThrottle | ( | ) |
Returns whether the nonblocking downloads will be bandwidth-limited.
See set_download_throttle().
| Streamsize getFileSize | ( | ) |
Returns the size of the file, if it is known.
Returns the value set by set_expected_file_size() if the file size is not known, or 0 if this value was not set.
If the file is dynamically generated, the size may not be available until a read has started (e.g. open_read_body() has been called); and even then it may increase as more of the file is read due to the nature of HTTP/1.1 requests which can change their minds midstream about how much data they're sending you.
| int getFirstByteDelivered | ( | ) |
Returns the first byte of the file (that will be) delivered by the server in response to the current request.
Normally, this is the same as get_first_byte_requested(), but some servers will ignore a subdocument request and always return the whole file, in which case this value will be 0, regardless of what was requested to get_subdocument().
| int getFirstByteRequested | ( | ) |
Returns the first byte of the file requested by the request.
This will normally be 0 to indicate that the file is being requested from the beginning, but if the file was requested via a get_subdocument() call, this will contain the first_byte parameter from that call.
| bool getHeader | ( | const DocumentSpec | url | ) |
Like get_document(), except only the header associated with the document is retrieved.
This may be used to test for existence of the document; it might also return the size of the document (if the server gives us this information).
| str getHeaderValue | ( | str | key | ) |
Returns the HTML header value associated with the indicated key, or empty string if the key was not defined in the message returned by the server.
| double getHttpTimeout | ( | ) |
Returns the length of time, in seconds, to wait for the HTTP server to respond to our request.
See set_http_timeout().
| HTTPEnum::HTTPVersion getHttpVersion | ( | ) |
Returns the HTTP version number returned by the server, as one of the HTTPClient enumerated types, e.g.
HTTPClient::HV_11.
| str getHttpVersionString | ( | ) |
Returns the HTTP version number returned by the server, formatted as a string, e.g.
"HTTP/1.1".
| double getIdleTimeout | ( | ) |
Returns the amount of time, in seconds, in which an previously-established connection is allowed to remain open and unused.
See set_idle_timeout().
| int getLastByteDelivered | ( | ) |
Returns the last byte of the file (that will be) delivered by the server in response to the current request.
Normally, this is the same as get_last_byte_requested(), but some servers will ignore a subdocument request and always return the whole file, in which case this value will be 0, regardless of what was requested to get_subdocument().
| int getLastByteRequested | ( | ) |
Returns the last byte of the file requested by the request.
This will normally be 0 to indicate that the file is being requested to its last byte, but if the file was requested via a get_subdocument() call, this will contain the last_byte parameter from that call.
| double getMaxBytesPerSecond | ( | ) |
Returns the maximum number of bytes per second that may be consumed by this channel when get_download_throttle() is true.
| double getMaxUpdatesPerSecond | ( | ) |
Returns the maximum number of times per second that run() will do anything at all, when get_download_throttle() is true.
| int getNumRedirectSteps | ( | ) |
If the document automatically followed one or more redirects, this will return the number of redirects that were automatically followed.
Use get_redirect_step() to retrieve each URL in sequence.
| bool getOptions | ( | const DocumentSpec | url | ) |
Sends an OPTIONS message to the server, which should query the available options, possibly in relation to a specified URL.
| bool getPersistentConnection | ( | ) |
Returns whether the HTTPChannel should try to keep the connection to the server open and reuse that connection for multiple documents, or whether it should close the connection and open a new one for each request.
See set_persistent_connection().
| str getProxyRealm | ( | ) |
If the document failed to connect because of a 407 (Proxy authorization required), this method will return the "realm" returned by the proxy.
This string may be presented to the user to request an associated username and password (which then should be stored in HTTPClient::set_username()).
| bool getProxyTunnel | ( | ) |
Returns true if connections always tunnel through a proxy, or false (the normal case) if we allow the proxy to serve up documents.
See set_proxy_tunnel().
| const URLSpec getRedirect | ( | ) |
If the document failed with a redirect code (300 series), this will generally contain the new URL the server wants us to try.
In many cases, the client will automatically follow redirects; if these are successful the client will return a successful code and get_redirect() will return empty, but get_url() will return the new, redirected URL.
| const URLSpec getRedirectStep | ( | int | n | ) |
Use in conjunction with get_num_redirect_steps() to extract the chain of URL's that the channel was automatically redirected through to arrive at the final document.
| list getRedirectSteps | ( | ) |
| int getSkipBodySize | ( | ) |
Returns the maximum number of bytes in a received (but unwanted) body that will be skipped past, in order to reset to a new request.
See set_skip_body_size().
| int getStatusCode | ( | ) |
Returns the HTML return code from the document retrieval request.
This will be in the 200 range if the document is successfully retrieved, or some other value in the case of an error.
Some proxy errors during an https-over-proxy request would return the same status code as a different error that occurred on the host server. To differentiate these cases, status codes that are returned by the proxy during the CONNECT phase (except code 407) are incremented by 1000.
| str getStatusString | ( | ) |
Returns the string as returned by the server describing the status code for humans.
This may or may not be meaningful.
| bool getSubdocument | ( | const DocumentSpec | url, |
| int | first_byte, | ||
| int | last_byte | ||
| ) |
Retrieves only the specified byte range of the indicated document.
If last_byte is 0, it stands for the last byte of the document. When a subdocument is requested, get_file_size() and get_bytes_downloaded() will report the number of bytes of the subdocument, not of the complete document.
| bool getTrace | ( | const DocumentSpec | url | ) |
Sends a TRACE message to the server, which should return back the same message as the server received it, allowing inspection of proxy hops, etc.
| const URLSpec getUrl | ( | ) |
Returns the URL that was used to retrieve the most recent document: whatever URL was last passed to get_document() or get_header().
If a redirect has transparently occurred, this will return the new, redirected URL (the actual URL at which the document was located).
| str getWwwRealm | ( | ) |
If the document failed to connect because of a 401 (Authorization required), this method will return the "realm" returned by the server in which the requested document must be authenticated.
This string may be presented to the user to request an associated username and password (which then should be stored in HTTPClient::set_username()).
| bool isConnectionReady | ( | ) |
Returns true if a connection has been established to the named server in a previous call to connect_to() or begin_connect_to(), false otherwise.
| bool isDownloadComplete | ( | ) |
Returns true when a download_to() or download_to_ram() has executed and the file has been fully downloaded.
If this still returns false after processing has completed, there was an error in transmission.
Note that simply testing is_download_complete() does not prove that the requested document was successfully retrieved–you might have just downloaded the "404 not found" stub (for instance) that a server would provide in response to some error condition. You should also check is_valid() to prove that the file you expected has been successfully retrieved.
| bool isFileSizeKnown | ( | ) |
Returns true if the size of the file we are currently retrieving was told us by the server and thus is reliably known, or false if the size reported by get_file_size() represents an educated guess (possibly as set by set_expected_file_size(), or as inferred from a chunked transfer encoding in progress).
| bool isValid | ( | ) |
Returns true if the last-requested document was successfully retrieved and is ready to be read, false otherwise.
| ISocketStream openReadBody | ( | ) |
Returns a newly-allocated istream suitable for reading the body of the document.
This may only be called immediately after a call to get_document() or post_form(), or after a call to run() has returned false.
Note that, in nonblocking mode, the returned stream may report an early EOF, even before the actual end of file. When this happens, you should call stream->is_closed() to determine whether you should attempt to read some more later.
The user is responsible for passing the returned istream to close_read_body() later.
| bool postForm | ( | const DocumentSpec | url, |
| str | body | ||
| ) |
Posts form data to a particular URL and retrieves the response.
| preserveStatus | ( | ) |
Preserves the previous status code (presumably a failure) from the previous connection attempt.
If the subsequent connection attempt also fails, the returned status code will be the better of the previous code and the current code.
This can be called to daisy-chain subsequent attempts to download the same document from different servers. After all servers have been attempted, the final status code will reflect the attempt that most nearly succeeded.
| bool putDocument | ( | const DocumentSpec | url, |
| str | body | ||
| ) |
Uploads the indicated body to the server to replace the indicated URL, if the server allows this.
| reset | ( | ) |
Stops whatever file transaction is currently in progress, closes the connection, and resets to begin anew.
You shouldn't ever need to call this, since the channel should be able to reset itself cleanly between requests, but it is provided in case you are an especially nervous type.
Don't call this after every request unless you set set_persistent_connection() to false, since calling reset() rudely closes the connection regardless of whether we have told the server we intend to keep it open or not.
| bool run | ( | ) |
This must be called from time to time when non-blocking I/O is in use.
It checks for data coming in on the socket and writes data out to the socket when possible, and does whatever processing is required towards completing the current task.
The return value is true if the task is still pending (and run() will need to be called again in the future), or false if the current task is complete.
| sendExtraHeader | ( | str | key, |
| str | value | ||
| ) |
Specifies an additional key: value pair that is added into the header sent to the server with the next request.
This is passed along with no interpretation by the HTTPChannel code. You may call this repeatedly to append multiple headers.
This is persistent for one request only; it must be set again for each new request.
| setAllowProxy | ( | bool | allow_proxy | ) |
If this is true (the normal case), the HTTPClient will be consulted for information about the proxy to be used for each connection via this HTTPChannel.
If this has been set to false by the user, then all connections will be made directly, regardless of the proxy settings indicated on the HTTPClient.
| setBlockingConnect | ( | bool | blocking_connect | ) |
If this flag is true, a socket connect will block even for nonblocking I/O calls like begin_get_document(), begin_connect_to(), etc.
If false, a socket connect will not block for nonblocking I/O calls, but will block for blocking I/O calls (get_document(), connect_to(), etc.).
Setting this true is useful when you want to use non-blocking I/O once you have established the connection, but you don't want to bother with polling for the initial connection. It's also useful when you don't particularly care about non-blocking I/O, but you need to respect timeouts like connect_timeout and http_timeout.
| setConnectTimeout | ( | double | timeout_seconds | ) |
Sets the maximum length of time, in seconds, that the channel will wait before giving up on establishing a TCP connection.
At present, this is used only for the nonblocking interfaces (e.g. begin_get_document(), begin_connect_to()), but it is used whether set_blocking_connect() is true or false.
| setContentType | ( | str | content_type | ) |
Specifies the Content-Type header, useful for applications that require different types of content, such as JSON.
| setDownloadThrottle | ( | bool | download_throttle | ) |
Specifies whether nonblocking downloads (via download_to_file() or download_to_ram()) will be limited so as not to use all available bandwidth.
If this is true, when a download has been started on this channel it will be invoked no more frequently than get_max_updates_per_second(), and the total bandwidth used by the download will be no more than get_max_bytes_per_second(). If this is false, downloads will proceed as fast as the server can send the data.
This only has effect on the nonblocking I/O methods like begin_get_document(), etc. The blocking methods like get_document() always use as much CPU and bandwidth as they can get.
| setExpectedFileSize | ( | int | file_size | ) |
This may be called immediately after a call to get_document() or some related function to specify the expected size of the document we are retrieving, if we happen to know.
This is used as the return value to get_file_size() only in the case that the server does not tell us the actual file size.
| setHttpTimeout | ( | double | timeout_seconds | ) |
Sets the maximum length of time, in seconds, that the channel will wait for the HTTP server to finish sending its response to our request.
The timer starts counting after the TCP connection has been established (see set_connect_timeout(), above) and the request has been sent.
At present, this is used only for the nonblocking interfaces (e.g. begin_get_document(), begin_connect_to()), but it is used whether set_blocking_connect() is true or false.
| setIdleTimeout | ( | double | idle_timeout | ) |
Specifies the amount of time, in seconds, in which a previously-established connection is allowed to remain open and unused.
If a previous connection has remained unused for at least this number of seconds, it will be closed and a new connection will be opened; otherwise, the same connection will be reused for the next request (for this particular HTTPChannel).
| setMaxBytesPerSecond | ( | double | max_bytes_per_second | ) |
When bandwidth throttling is in effect (see set_download_throttle()), this specifies the maximum number of bytes per second that may be consumed by this channel.
| setMaxUpdatesPerSecond | ( | double | max_updates_per_second | ) |
When bandwidth throttling is in effect (see set_download_throttle()), this specifies the maximum number of times per second that run() will attempt to do any downloading at all.
| setPersistentConnection | ( | bool | persistent_connection | ) |
Indicates whether the HTTPChannel should try to keep the connection to the server open and reuse that connection for multiple documents, or whether it should close the connection and open a new one for each request.
Set this true to keep the connections around when possible, false to recycle them.
It makes most sense to set this false when the HTTPChannel will be used only once to retrieve a single document, true when you will be using the same HTTPChannel object to retrieve multiple documents.
| setProxyTunnel | ( | bool | proxy_tunnel | ) |
Normally, a proxy is itself asked for ordinary URL's, and the proxy decides whether to hand the client a cached version of the document or to contact the server for a fresh version.
The proxy may also modify the headers and transfer encoding on the way.
If this is set to true, then instead of asking for URL's from the proxy, we will ask the proxy to open a connection to the server (for instance, on port 80); if the proxy honors this request, then we contact the server directly through this connection to retrieve the document. If the proxy does not honor the connect request, then the retrieve operation fails.
SSL connections (e.g. https), and connections through a Socks proxy, are always tunneled, regardless of the setting of this flag.
| setSkipBodySize | ( | int | skip_body_size | ) |
Specifies the maximum number of bytes in a received (but unwanted) body that will be skipped past, in order to reset to a new request.
That is, if this HTTPChannel requests a file via get_document(), but does not call download_to_ram(), download_to_file(), or open_read_body(), and instead immediately requests a new file, then the HTTPChannel has a choice whether to skip past the unwanted document, or to close the connection and open a new one. If the number of bytes to skip is more than this threshold, the connection will be closed; otherwise, the data will simply be read and discarded.
| bool willCloseConnection | ( | ) |
Returns true if the server has indicated it will close the connection after this document has been read, or false if it will remain open (and future documents may be requested on the same connection).
| writeHeaders | ( | Ostream | out | ) |
Outputs a list of all headers defined by the server to the indicated output stream.


{% extends "get-involved/base.html" %} {% block title %}Get Involved Communities - {{ block.super }}{% endblock title %} {% block section %}
Whether in the commercial, social or government sectors, technology has the power to spur innovation, engage citizens, leverage untapped assets, create efficiencies and change lives. To that end, US Ignite is a convener of stakeholders that have a vested interest in working together to stimulate the research, development, and promotion of next-generation networks and applications to transform sectors of national priority such as education, healthcare, workforce development, energy, public safety, advanced manufacturing and transportation. Our intent is to complement, support, and facilitate relationships among key stakeholders providing opportunities to magnify their impact and transform sectors of national priority.
Here are three ways to get you started:
{% endblock section %} {% block related %}{% endblock related %}


Attitude is a little thing that makes a big difference.
Writing content is good but writing a Marketable content is something that requires a deep understanding of branding and we are right there! Our content extends and provokes conversation within a community, driving engagement and interaction with the brand.
The success of your content marketing strategy depends on the nature of your content. If your content is good and by good I mean straight out of the top drawer, it will bolster your content marketing efforts. On the other hand, if it is fairly ordinary, your inbound marketing campaign will fall apart faster than you realize.
If you are a part of the 77% B2C or 86% B2B organizations using content marketing to boost brand growth, you must make a concerted attempt to come up with high quality content that not only disseminates useful information but also does so in a manner that is engaging and arresting.
Five Content Marketing Examples
Why Content Marketing?
Perhaps more important than understand what content marketing is, is understanding why content marketing is important to your business. First we need to understand the four steps of the buying cycle:
At my own company we've used content marketing to grow more than 1,000% over the past year. Potential clients find our content, find value in it, and by the time they contact us they're already convinced they want to work with us. We don't have to engage in any high pressure sales tactics, it's merely a matter of working out details, signing an agreement, and getting started. The trust that usually needs to be built up during an extensive sales cycle has already been created before we know the potential client exists.
Content marketing also provides additional benefits in that it supports other digital marketing channels. It provides additional content for social media marketing and contributes to SEO efforts by generating natural inbound links and building up good content on your website that gets found in search engines. In fact, for many companies the bulk of their SEO efforts should be focused on content marketing.


John Gruber (of Daring Fireball) write The Location Field is the New Command Line, talking about the success of web applications.
The persnickety little UI details I obsess over -- these are nothing compared to the massive deficiencies of even the best web app. But most people don't care, because web apps are just so damned easy to use. What's interesting is that web apps are "easy" despite their glaring user experience limitations.What they've got going for them in the ease-of-use department is that they don't need to be installed, and they free you from worrying about where and how your data is stored.
I would go further -- the web UI certainly has deficiencies, but it also has features that have been unappreciated by traditional UI developers. Some of these:
The problem is that there's a lot of stuff that can be done on the Web which no-one designing a Web application should realistically consider, since it could destroy the accessibility of the application, but which managers seem to want anyway. Fuelled by ignorance in the "design" phase, bad user interfaces actually get implemented without the developers getting a decent opportunity to use the excuse that "it can't be done".
Perhaps I'm just too honest and should deny all knowledge of bizarre DHTML tricks to copy things between frames, use CSS to make things invisible, just to pander to clueless managers who think that the Web is just a Windows application in a little box. And don't get me started on ActiveX...# The Badger
Ian,
Love it!! Web is the good bad thing.
Good:
Pretty standard and everyone has to support it even if they don't support it well. (M$)
Bad:
Stateless, ohh what I would do for a stateful connection everyonce in a while. JavaScript was a bad idea and still is really nasty.
Future:
I am thinking we are in a transistion to more flash type interfaces. What ever we get after DHTML should be pretty cool for solving some of the widget control and helping with statelessness.
Cheers,
Lateef
# Lateef Jackson
I certainly hope that we don't move to flash-type interfaces. Though the SVG people seem to be interested in that -- I can only hope WHAT can provide an alternative. There are certainly some applications that really can't be done without a richer client (e.g., build-your-own applications where you get to preview the composition of several attributes in a product). But that doesn't describe most of the web.# Ian Bicking
The only problem I have seen with web applications is that everyone wants EVERYTHING on the web.
Unlike the rest of the world I take the position that even though the web is great, there are some applications that do not ever need to be "on the web."
This is vague, but there are LOTS of applications that have high UI requirements that will never be successful on the web.
Most web applications are consistent because of lack of controls to choose from. If you want to run everywhere you are limited to the most basic controls and as you said no menus. Lack of choice in this case is a good thing.
If you ignore flash as a web development platform there really are no choices. There are choice in the plumbing... how you get the textbox to the browser but in the end it is at best still a textbox.
My point is that in the end, you really still have a textbox. And for the most part a textbox that you cannot really do anything with, other than read values once a submit button is pressed.
Are web apps really just an alternate reality where we are all working in a really bad version of VB?
Actually I would not say it is about resources and tasks, it is about process. Process is what is interesting. Companies have plenty of resources in their warehouses, and workers know how to do tasks, but unless an order comes from the customer, the shipping process never starts.
A large part of UI problems arise when people focus on the tasks instead of the process. Simplistically, if you want to provide ETDBW, you must re-engineer the process, not the resources and the tasks.
I think web apps are complete and distinct programs. Use Java Servlets you will see that web based enterprise applications are much more challenging than you think, add security issues and you can easily turn your web app into a critical system (i.e. Online Banking).
As for the UI, there is nothing you can't do in html and flash. You can even implement the drag and drop if you want.
# Roger


--- layout: frontpage ---
This stuff is for sale, and the prices are insane. Don't miss out! This is a demo site. Visit the project site for more information.
How This Works »


Profile
Add Post
Friends
Friends List
Add friends
Remove Friends
Settings
Update Profile
Delete Account
Log Out
☰


mkdir </mnt/point/here> create a dir
mount </dev/sda1> </mnt/point/here> mount a drive
umount </mnt/point/here> unmount a drive


| XMR Stak |
CPU & GPU (AMD/NVIDIA) |
Easy to use CPU + GPU Mining App |
Download |
See more |
"pool_list": [
{
"pool_address": "POOL_HOST:PORT",
"wallet_address": "YOUR_WALLET_ADDRESS",
"rig_id": "YOUR_WORKER_NAME",
"pool_password": "x",
"use_nicehash": false,
"use_tls": false, /* Set to true if you are using an SSL port */
"tls_fingerprint": "",
"pool_weight": 1
},
],
"currency": "",
|
| XMRig |
CPU |
Ligthweight but powerful CPU Mining App |
Download |
See more |
"pools": [
{
"url": "POOL_HOST:PORT",
"user": "YOUR_WALLET_ADDRESS",
"pass": "YOUR_WORKER_NAME",
"keepalive": true,
"nicehash": false,
"variant": 1
}
],
|
| XMRig-AMD |
OpenCL (AMD) |
XMRIG version for AMD GPU |
Download |
See more |
"pools": [
{
"url": "POOL_HOST:PORT",
"user": "YOUR_WALLET_ADDRESS",
"pass": "YOUR_WORKER_NAME"
"keepalive": true,
"nicehash": false,
"variant": 1
}
],
|
| XMRig-NVIDIA |
Cuda (Nvidia) |
XMRIG version for Nvidia GPU |
Download |
See more |
"pools": [
{
"url": "POOL_HOST:PORT",
"user": "YOUR_WALLET_ADDRESS",
"pass": "YOUR_WORKER_NAME"
"keepalive": true,
"nicehash": false,
"variant": 1
}
],
|
| XMRigCC |
CPU |
XMRIG Fork, optimized with remote control |
Download |
See more |
"pools": [
{
"url": "POOL_HOST:PORT",
"user": "YOUR_WALLET_ADDRESS",
"pass": "YOUR_WORKER_NAME",
"keepalive": true,
"nicehash": false
},
],
|
| SRBMiner Cryptonight AMD GPU Miner |
OpenCL (AMD) |
XMRIG version for AMD GPU |
Download |
See more |
{
/* Type can be : normal, lite, heavy */
"cryptonight_type" : "heavy",
/* Intensity 0-> auto intensity, or value from 1-200 */
"intensity" : 0,
/* To use 2 threads per card set double_threads to true */
"double_threads" : false,
/* Gpu target temperature, leave it on 0 if you don't want to use this option */
"target_temperature" : 0,
/* If you use a SSL/TLS encrypted pool set this to true*/
"pool_use_tls" : false,
/* Mining pool address WITHOUT the stratum+tcp:// or stratum+tls:// part */
"pool" : "POOL_HOST:PORT",
/* Address of you wallet */
"wallet" : "YOUR_WALLET_ADDRESS",
/* Password for your wallet, probably just x */
"password" : "YOUR_WORKER_NAME",
/* Location for devfee servers, to get better latency */
"location" : "europe",
/* If you want to log console output, put a filename here */
"log_file" : "",
/* Charity mining, if you want to disable charity mining just delete these lines, or set values to "" (empty) */
"charity_pool" : "POOL_HOST:PORT",
"charity_wallet" : "YOUR_WALLET_ADDRESS",
"charity_password" : "YOUR_WORKER_NAME",
/* Settings for each GPU manually */
/* Put in devices that you want to use, if you for ex. don't want to use gpu 2, just don't insert it,like in this example */
/* Id starts from 0 , not from 1 !! */
/* To get a list of available devices with their id's, use --listdevices parameter */
/* This is just an example, edit it and remove comment lines (the slash and star) !! */
/*"gpu_conf" :
[
{ "id" : 0, "intensity" : 0, "double_threads" : true},
{ "id" : 1, "intensity" : 60, "double_threads" : false},
{ "id" : 3, "intensity" : 50, "double_threads" : true},
{ "id" : 4, "intensity" : 0, "double_threads" : true},
]*/
}
|


In order to check whether the given email is valid according to RFC 5322, 5321 and 3696, use this form. All the results will be output below the input field.
In order to check whether the given email is valid according to RFC 5322, 5321 and 3696, use this form. All the results will be output below the input field.