w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
ios: Secure a connection to a webserver so that only the app can communicate
You need to do some reading about Securing a web-service, you can start from below: OAuth Introduction Designing a Secure REST (Web) API Plus take a look at this question. Cheers.

Categories : IOS

Connection Monitoring between Arduino and Webserver
I'm not sure what you consider being your "session id", but I think you're using it more like an API key to identify your device towards the web service. Session ids are usually tokens put into cookies in HTTP requests, and are a pain to manage and track, and you don't need them for your use case. Just POST the token, and get it through the $_POST variable! And as I suggested in a comment, why don't you just make a program that sends ICMP/Ping to the Arduino, and when it does not answer, identify it as "offline"? It would be less trouble, and avoid you to add another responsibility in your Arduino.

Categories : PHP

web2py webserver - Best way to keep connection to external SQL server?
If you run that code in a web2py model file, you'll end up creating a new connection on each HTTP request anyway. Instead, you might consider connection pooling. An easier option might be to use the web2py DAL to fetch the data. Something like: from pandas.core.api import DataFrame db = DAL([db connection string], pool_size=10, migrate_enabled=False) rows = db.executesql(query) data = DataFrame.from_records(rows, columns=[list, of, column, names]) If you specify the pool_size argument to DAL(), it will automatically maintain a connection pool to be used across requests. Note, I haven't tried this, so it may need some tweaking, but something along these lines should work. If you'd like, you can even use the DAL to generate the SQL by defining database table models: db.define_table('m

Categories : Python

Connection refused for PHP curl() when starting PHP webserver via exec()
I think that you rush! You start the webserver in background using "&" Then you try to connect, but in that moment, your web server is not fully started, so it's not listening! <?php echo "Starting server... "; exec("php -S localhost:8000 -t /path/to/files > /dev/null & echo $!", $output); // sleep 1-5 seconds sleep (5); $ch = curl_init("http://localhost/"); curl_setopt($ch, CURLOPT_PORT, 8000); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec($ch); if(curl_errno($ch)) { echo 'Curl error: ' . curl_error($ch); } // Close handle curl_close($ch); echo "PID: ".$output[0]." "; exec('kill '.$output[0]);

Categories : PHP

Making multiple connection in ios
Your problem is pretty common when people start using NSUrlConnection delegates, First thing you're setting the delegate of both views to the same object, which can work, but will need some hackery. I recommend one of the following solutions: Solution 1 (uses delegates, more work) Create a new class, and give give it the NSURlconnection delegate protocol and call it something like apiFetchDelegate Then place your delegate methods in there -(void) connectionDidFinishLoading, etc.. Now in your viewDidLoad method, change it to the following: NSURL *headlineurl = [NSURL URLWithString:@"api1"]; headlinerequest = [NSURLRequest requestWithURL:headlineurl]; //Create a new instance of the delegate apiFetchDelegate* headlineDelegate = [[apiFetchDelegate alloc] init]; [[NSURLConnection alloc]

Categories : Iphone

Making a connection to QEMU with Libvirt Java API
It seems the address is not ok. "qemu+type://loginname@ip:port/system" would be right. In your case it seems 192.168.122.0/24 is an ip and subnetmask because /24 equals subnetmask 255.255.255.0 and doesn't belong here... If it is a port you have to write :24. Also /system is missing qemu+tcp://192.168.122.0:24/system should do the job - if not try two things: 1st Get rid of :24 and test 2nd Add username as shown above and test One of this possibilities should work assuming the rest of your code is correct. Have fun!

Categories : Java

Crystal Reports 9 making new connection to ODBC Simba Client
The first warning on connection is from Crystal Reports trying to set the ODBC version to 3, however the ODBC client you're using only supports ODBC 2. The warning is informational and is unlikely to cause your problem. The second error when CR9 is trying to get the SQL_CATALOG_NAME is because the SimbaClient ODBC Driver in use here does not support this attribute. I'm unsure of the database that you're connecting to with your SimbaClient ODBC driver, however you should contact the vendor of the database to see if they have an updated version of their software which supports ODBC 3.

Categories : SQL

How can I test inapp purchases when the connection fails right after making a purchase?
Well you don't need to go into all that physical pain of smashing your router and stuff :)... Please check these links . There are more elegant and simple ways of testing an in-app purchase. How To Test An InApp purchase Testing In-App purchasing Iphone I cannot get in app purchase test to work Also if you would go through this tutorial at the end they do explain how to test an inapp purchase plus an apple store link to guide you through In App Purchase Tutorial Apple InApp Store Hope these help :).

Categories : Iphone

error making connection with database in xcode? cannot connect with the database
For learners like me i would suggest them to make a simple core data app once you made it then you will know how to import add an isolated db. By the way core data itself make an sqlite db for you. so first go through the core data as it is the first step to play with db programming in IOS.

Categories : IOS

MSBuild C++ - Making an XML script for making automated builds
Assuming VS2012 as I can't rememeber what 2010 supported: You can either set up a solution via the GUI and add projects to it and then set up dependencies via Right Click Solution -> choose "Project Dependencies..." and setup your dependencies. MSBuild can build sln files just fine. Alternatively (and what we do) is manually edit the vcxproj files to specify their dependencies via project references in an item group. This means you don't need sln files, and just building any project will automatically build its references projects if necessary. <ProjectReference Include="PathTo.vcxproj"> <Project>GuidOfProject</Project> <Name>Name</Name> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> <LinkLibraryDependencies>false</Lin

Categories : C++

Webserver can not be started
This code Intent f = new Intent(JHTTS.this, JHTTP.class); is to start an Activity as if JHHTP was an Activity but it's not, its a Thread inside the Activity. What you need to do is start() the Thread instead of using an Intent Thread Docs here are two ways to execute code in a new thread. You can either subclass Thread and overriding its run() method, or construct a new Thread and pass a Runnable to the constructor. In either case, the start() method must be called to actually execute the new Thread. Instead of using Intent try something like JHTTP jhttp = new JHTTP(); jhttp.start();

Categories : Java

Using git to just monitor changes on a webserver
Yes, using Git on a server should not interfere with the normal operation of the server (as mentioned in the comments, doing this on a production server is dodgy but I'll leave that to one side.) Note that using Git normally will create a .git directory at the root of whatever you're tracking. If that is your web server root directory, you might want to consider whether this is a risk as far as external access to the contents of the .git directory (depending on your server setup, this may or may not be a concern). If you want to create the .git directory somewhere else outside your working tree, see the GIT_DIR environment variable.

Categories : Linux

Using php-cgi with webserver in android
You can use the Process and ProcessBuilder classes to create and execute an command. Keep in mind that depending on the process you want to execute, you may require root permissions and it won't work on non-rooted Android devices. String pathToPhpExecutable = getFileDir() + "/php-cgi"; String phpFile = getFileDir() + "/php/myPhpFile.php"; Process process = new ProcessBuilder() .command(pathToPhpExecutable, phpFile) .redirectErrorStream(true) .start(); try { InputStream in = process.getInputStream(); // Read the input stream and i.e. display the results in a WebView } finally { process.destroy(); } Don't be confused by the naming. According to the Process documentation getInputStream() returns the output of the stream connected to the std::out. This will return Code (Json,

Categories : Java

How to connect to a webserver on ec2 'privately'
Create a security group that only allows traffic from your IP (the IP of the machine running the browser where you will do the testing) to the web server port (80, probably) and assign this security group to your ec2 instance. This way only you can access the web app. If you need to work from different locations, write a simple script to update the security group and add your current IP. These changes are applied immediately and do not require a restart. You can grab your current IP from whatismyip and use the Amazon SDK to update the security group.

Categories : Amazon

WebServer listen on SSL and all addresses
Are you sure nothing else is registered to listen on 443? 'Cause * is a "weak" wildcard and if something else is listening on that port using a "stronger" URL registration than that it would explain why it does not work. So, first, try https://+:443 and see if that works or even specify a base path like https://+:443/SignalRTest. That's the strongest possible form of wildcard. If you're still having issues, I'd check to make sure there are no other registrations for 443 with something like: netsh http show urlacl

Categories : Asp Net

WebServer or SocketProgramming for android
For an eCommerce app, I recommend you to use web service other than socket. You can implement simple authentication mechanism for restricting the access. And the sun.net.httpserver package is very convenient for you to start with. You might also want to try NanoHttpd.

Categories : Android

Webserver not showing images
You're explicitly setting the Content Type to text/html for every item: response+= "Content-Type: text/html "; This will work fine for content which is text and/or HTML, but for anything else (such as images) it will confuse the web browser. You're basically telling the web browser to treat the image's raw data as text. It's trying to comply with this, but naturally it's unable to do so. Your web server is going to have to determine the file type and use the correct Content Type for that file when building the HTTP response.

Categories : Java

How to Block Particular Areas from my WebServer
You can use this Geo API from JavaScript to detect where the user comes from and handle the redirect using window.load. I don't find this as the right approach since users can block JavaScript execution in their browsers. On the other hand, you can use MaxMind IP GeoLocation database and use some business logic to detect the IP addres using a Servlet-Filter and method ServletRequest#getRemoteAddr(): @WebFilter("/*") public class IPFilter implements Filter { @Override public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { String clientIp = req.getRemoteAddr(); if (bannedIp(clientIp) { response.sendRedirect(request.getContextPath() + "/bannedIp.jsp"); return; }

Categories : Java

Webserver socket programming
You are conflating 'listen to' and 'read from'. They aren't the same thing. 'Listen to' means that the server creates a listening socket from which connections can be accepted, in large numbers. Each of those connections than then be read from and written to.

Categories : Java

My webserver service is not stoping
Check to avoid calling the function when it is null if(pro != null){ pro.stop(); } How do you start the JHHTP Client? JHHTP pro = new JHTTP(rootDir, 1234) //second one is Port because the constructor looks like this: public JHTTP(File documentRootDirectory, int port) throws IOException { //blah blah blah }

Categories : Java

transfer files from one webserver to another
use the php ftp functions. Set ini_set('max_execution_time', 0); and ignore_user_abort(1) then $File = "PathToFile"; $Ftp = ftp_connect("IP of the othe server that will receive the file"); ftp_login($Ftp,"ftpuser","ftppassword"); ftp_pasv($Ftp,true); // Join pasv which is always better ftp_put($Ftp,"Path in the remote server",$File,FTP_BINARY); ftp_close($Ftp); Always use FTP_BINARY when sending binary files and of course fire the php script, via web browser or cron Edit: Forgot ftp_login()

Categories : PHP

Setting up a secure webserver
This question is asking for an opinion. Basically any linux web host will provide most of what you're looking for. You're asking for an opinion about which hosting site is the best. I cannot answer that. What I do want to warn you about is this: From your question, you're concerned with: - security this is not a web host provider feature, but a feature of secure web code. See https://www.owasp.org/index.php/Top_10_2013 for great introduction to website security. obscure code You cannot prevent someone from stealing your css. They will not get to your raw templates (I'm assuming you're using templates) if you set your file permissions right on the web server. if you're concerned with brute force protections, you'll need to code that up yourself. The web host provider would not (and

Categories : Security

How do I know what webserver gradle / grails is using?
Gradle is nothing but a build and config tool like maven. When you use it with Grails app the dependencies are managed by it as it happens when maven is used. When you use gradle grails-run-app it does nothing more other than running grails run-app from its own context. The same embedded Tomcat server is used by default.

Categories : Grails

Webserver do not open php files
You need a module to handle php requests like php-fpm or fast-cgi, or maybe something like that http://php-java-bridge.sourceforge.net/doc/how_it_works.php

Categories : Java

Deploying meteor app to a webserver
Make your project locally Build your project locally, you could test it using meteor run or even meteor deploy xxx.meteor.com to see if its working Bundle your app Use meteor bundle deploy.tar.gz to make a file called deploy.tar.gz in your meteor directory containing your project Upload your file to your server This depends more on how your server is/what your platform is but you can use a tool to upload it for you (e.g Transmit on mac) Install node.js & fibers on your platform if you don't have it already This depends alot on your server platform. Have a look at http://nodejs.org/ for more detailed instructions Extract your bundle If on a *nix platform you could do the below in the directory where you uploaded your bundle (explanation): tar -xzvf bundle.tar.gz Enter the di

Categories : Mongodb

Sencha touch, android and webserver
Have you tried to package the app using PhoneGap? If you enable PhoneGap to reach your URL (and, of course, you expose your "positionservlet" API to the extern) you should be able to reach it without Cross-Domain issues

Categories : Javascript

Webserver for Go (golang) webservices: using NGINX or not?
The standard http server of Go is fine. If your application mostly/only are "dynamic" requests/responses, then it's really the best way. You could use nginx to serve static assets, but most likely the standard Go one is fine for that, too. If you need higher performance you should just use a CDN or cache as much as you can with Varnish (for example). If you need to serve different applications off the same IP address, nginx is a fine choice for a proxy to distribute requests between the different applications; though I'd more often get Varnish or HAProxy out of the toolbox for that sort of thing.

Categories : Web Services

Allow uppercase table name linux webserver
Its a solution for win7-apachi 2.2.11-php 5.3-mysql 5.1.36 1- Go to your my.ini file of your MySQLand add this line at the end1 lower_case_table_names=2 This tells MySQL to preserve cases for table names. This file should be located in your bin directory of your MySQL install folder 2- Restart your MySQL 3- Now simply go to phpmyadmin, rename the table to any temp name, then rename the temp name back to the original with upper case.

Categories : C#

High performance webserver design
As the data behind the primary keys are small (some Bytes), filesystem will not be an efficient solution, consider using some caching system as Redis as a database. Nginx as webserver seems more suitable to your needs than apache (small requests, and much people) If all your data (~100B * 100k ~ 10MB ?) fit into memory, and there is no big calculation, you should not encounter hard performance issues.

Categories : Database

Creating a simple webserver using sockets
I assume this is a training exercise? You need to keep reading from the socket and parsing as you go, until you determine you have read the entire header. Then you need to parse it (if you haven't already done so), and send a response. So, you can't have just one recvfrom(), you need to loop. It also won't (efficiently) handle multiple browsers until you explicitly support it, via poll/select and/or threads and/or forked processes.

Categories : HTML

Export Chart Using PhantomJS From WebServer
file download isn´t supported by PhantomJS.. That's why the phantomjs export-module is returning a 64 bit string representation of a image. So, in the end this isn't going to work out of the box. You get the Unable to Parse JSON error because the PhantomJS script is expecting this format {infile: ... , outfile: ...} and standard export functionality of Highcharts is sending a POST request with post parameters.

Categories : Highcharts

Parse json array from webserver
Try something like this: //code is a String where you saved the json JSonObject json= new JsonParser().parse(code).getAsJsonObject(); JsonArray jArray= json.getAsJsonArray("Level"); rLevel=new ArrayList<LatLng>(); //notice the use of the size() method. There is not length() method defined for ArrayList System.out.println("*****JARRAY*****"+jArray.size()); for(int i=0;i<jArray.size();i++){ //notice that inside the Level Array you have route-arrays JSonObject level_item = jArray.get(i).getAsJsonObject(); JSonArray route= level_item.getAsJSonArray("route"); //now I don't know exactly what data you want to extract, since there are 2 //pairs of LatLng, for the first one: jlat = route.get(0).get("lat").getAsDouble(); jlgn= route.get(0).get("lgn").getASDouble(); The exact

Categories : Java

Upload to webserver from multiple devices
Take a look at Parse.com's data solution. You can set up a free account and have your devices post the data a database using their API. Pretty easy to set up with iOS and for basic services it's free.

Categories : IOS

Mimic a signed on client to webserver
The problem seems to be in cookie-based authentication. If speed is not that much of an issue, or the webserver requires JavaScript to work, the easiest solution would be in using selenium. https://pypi.python.org/pypi/selenium from selenium import webdriver import time browser = webdriver.Firefox() # Start a firefox instance in "WebDriver" mode browser.get("http://www.example.com") # load the page assert "Example Domain" in browser.title # make sure that we have the right page elem = browser.find_element_by_tag_name("a") # find the only link elem.click() # click on the link time.sleep(0.2) # Let the page load # etc. etc. You can fill out forms, wait for some specific content to appear etc.

Categories : Python

node.js webserver and C++ game server
First, there's the option of connecting your clients directly to your C++ server. If your socket.io transport is websockets, for example, you can use http://libwebsockets.org (a C++ websockets library for the server-side). Otherwise, you could let your clients connect the socket.io to your node.js server, and establish some simple communication between your C++ server and node.js server. Don't try to "handle off the socket.io to the C++ server": simply have the C++ server and the node.js server communicate between themselves, passing messages back and forth, about players' states: the C++ would handle the logic, and the node.js would do the actual sending and receiving. You can do that, for example, with a simple TCP socket.

Categories : C++

Soft terminating a simple webserver
After the suggestions of @Medinoc, @someuser and @Elchonon I corrected my code in the following way: #include <stdio.h> #include <stdlib.h> #include <netinet/in.h> #include <signal.h> #define SERVER_PORT 80 int nStatus, nMainSocketId; void onInt () { printf("You have pressed CTRL-C. "); nStatus = 0; shutdown(nMainSocketId, 2); } void onQuit () { printf("You have pressed CTRL-\. "); nStatus = 0; shutdown(nMainSocketId, 2); } int main () { int nReqSocketId, nReqSize = 1024; nMainSocketId = socket(AF_INET, SOCK_STREAM, 0); char *sRequest = malloc(nReqSize); socklen_t nAddrLen; struct sockaddr_in oAddress; signal(SIGINT, onInt); signal(SIGQUIT, onQuit); oAddress.sin_family = AF_INET; oAddress.sin_addr.s

Categories : C

How do I request a variable from the webserver using AJAX?
Take a look at WebSockets, which allow a server to send a message to a browser whenever it wants to, once a connection is established. You handle the incoming message with a Javascript event handler, thus avoiding the need to poll continuously. WebSockets are suported by all major browsers, including IE10. You'd have to make sure, of course, that your server application can support WebSockets too.

Categories : Javascript

How to invoke QTP on a server from a webserver through C# or VBS coding
Can you check whether you have permissions specific to the QTP Remote Agent COM service on your target machine. Here are the steps: Go to Control Panel>Administrative Tools>Component Services. In the Component Services snap-in, navigate to ComputersMy ComputerDCOM Config. In the right pane, locate AQTRmtAgent. Right- click the AQTRmtAgent and then select Properties. On the Security tab, select Customize, and then click Edit. Add the user to the permissions list. PS: Sorry I just re-read your question and you mention you have tried adding the user to COM settings but it does not specify which process you tried to add, So I'll keep my post and try to help based on your response.

Categories : C#

mpdf is direct downloading webserver
maybe the server's sent different header information. // set these two header to open the file in your browser header("Content-Type: application/pdf"); header("Content-Disposition: inline; yourfilename.pdf"); include("mpdf/mpdf.php"); $mpdf=new mPDF(); $html = 'some html' $mpdf->WriteHTML($html); $mpdf->mirrorMargins = 1; $mpdf->SetDisplayMode('fullwidth','continuous'); $mpdf->output(); exit();

Categories : PHP

Running a simple webserver in Docker?
I think you CMD syntax is wrong. i just tried and it works fine: FROM ubuntu # Install python3 RUN apt-get update RUN apt-get install -y python3 # Copy html ADD static/ /src RUN cd /src # Run http server on port 8080 EXPOSE 8080 CMD ["python3", "-m", "http.server", "8080"]

Categories : Docker



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.