w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
jQuery GET to API on same domain gives CORS error
Out of your comment i know that you use an adblocker. The problem with adblockers is, that they block by matching rules, either by url or by certain dom structure (like class names or ids). In general if you have a problem with a browsers test it with all extensions disabled. This can (in most cases) be done by using the privacy mode, because many of the bad extensions are disabled there. Or using a profile with no extensions installed. If everything works well there then it is most likely an interfering extension. In your case the problem is with the url: http://bwq.aintno.info/ads/api/index.php/specimens ^________^ For this portion there is a match rule in e.g. EasyList (.info/ads/) - most likely there are similar rules in other lists. So general having somethi

Categories : Jquery

CORS - Cross-Domain AJAX Without JSONP By Allowing Origin On Server
There is no need to use JSONP if you enable CORS. Access-Control-Allow-Origin: http://www.example.com if this header is set in the response, then normal XmlHttpRequest will be able to access the response as if it is like same domain. Check whether this header is set correctly. I hope that this link will help you if you are using jquery A CORS POST request works from plain javascript, but why not with jQuery? Update: Example var xmlhttp= new XMLHttpRequest(); var url="https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS?redirectlocale=en-US&redirectslug=HTTP_access_control"; xmlhttp.open("GET",url,false); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlhttp.send(); Try this in any domain, you will get response. Upd

Categories : Javascript

Is it possible to know if the client (browser) is running on the same machine as the server?
I guess you can check whether the ip address of the request is the same as server's or if it's coming from localhost? I guess this can help: String getRemoteIP(HttpServletRequest request) { String xff = request.getHeader("X-Forwarded-For"); if (xff != null) { return xff.split("[\s,]+")[0]; } return request.getRemoteAddr(); } Compare this address to server's. I took this code from here

Categories : Java

How to connect to a MySQL server running on a Virtual Machine
You problem is that (probably) your mysql is bind to 127.0.0.1 instead of 0.0.0.0. You should change bind in /etc/mysql/my.cnf to 0.0.0.0 bind-address = 0.0.0.0 And then restart mysql of course.

Categories : Mysql

Kerberos authentication not running when client and server on same machine
IE and all browsers using SSPI send by default a NTLM token in this case. See Are the client and server on the same box?. The issue is described in MS's knowledge base with possible solutions.

Categories : Java

cross domain issue with angularjs form post (file upload using ngUpload) and nodejs server
You could use CORS if your browser supports it. Since you want to post data you can't send it as JSONP (which only supports GET requests), but there are some other workarounds you could use instead.

Categories : Javascript

How to set a web service on AMAZON (AWS) which is running a NODEJS server?
Use NODEJS or EXPressJS get the server running ! Then use something like http://Serverip::port to access from your mobile that should work

Categories : Mysql

Error Handler Nodejs Redis Connect-domain fail
Not sure if the domain should be catching that or not - but you can capture redis errors by setting up an error handler, like this: // handle redis connection temporarily going down without app crashing redisClient.on("error", function(err) { console.error("Error connecting to redis", err); }); While the connection is broken your handler will keep getting called as redis tries to reconnect. If it's eventually successful everything will come back online on it's own.

Categories : Node Js

Grunt Server: Not supporting CORS, gives error
I'm not sure what you mean by "my grunt file doesn't look the same", but you need to read the documentation of grunt-contrib-connect documentation which tells you that the middleware option accepts a function which should return an array of middlewares. The referred gist is a simple middleware which allows CORS. In your case it would look like: connect: { options: { port: 9000, // Change this to '0.0.0.0' to access the server from outside. hostname: 'localhost' }, livereload: { options: { middleware: function (connect) { return [ lrSnippet, mountFolder(connect, '.tmp'), mountFolder(connect, yeomanConfig.app), function(req, res, next) { res.setHeader('Access-Control-Allow-Origin', '*'); re

Categories : Angularjs

Error: Received rst: 1 when running nodejs spdy example
I've seen this error a few times in older versions (1.9.x) of node-spdy. Try upgrading to the newest NodeJS stable and the latest node-spdy (at this time, 1.10.5). That has resolved the issue for me. Edit: Actually, this has not resolved the issue, I still get it when sitting in the debugger for a long time, essentially timing out a push connection. I will update this question if I fix the issue.

Categories : Node Js

new to cross domain CORS
You should add it on http://domain2.com because Access-Control-Allow-Origin is permission for http://domain1.com to get information from http://domain2.com. Note that (*) symbol means that domain allows access to everyone, so you need to be careful with that. Better option would be: Access-Control-Allow-Origin: http://domain1.com It work fine for IE and for https: Access-Control-Allow-Origin: http://domain1.com, https://domain1.com Take a look for more information here.

Categories : Asp Net

PyDev: Running Code in local machine to remote machine
One solution would be: Install python on the remote machine Package your code into a python package using distutils (see http://wiki.python.org/moin/Distutils/Tutorial). Basically the process ends when you run the command python setup sdist in the root dir of your project, and get a tar.gz file in the dist/ subfolder. Copy your package to the remote server using scp, for example, if it is an amazon machine: scp -i myPemFile.pem local-python-package.tar.gz remote_user_name@remote_ip:remote_folder Run sudo pip install local-python-package.tar.gz on the remote server Now you can either SSH to the remote machine and run your code or use some remote enabler such as fabric to start commands on the remote server (works for any shell command, specifically python scripts) Alternatively, you c

Categories : Python

NodeJS gives Cannot find module './parser' error while running Handlebars
For simplicity reasons: Just download all the necessary packages on a PC with internet access (so actually just run npm install in the handlebars folder) and then just copy the folder with all the modules

Categories : Javascript

Single-Sign-On from Windows Workstation to PHP script running on Linux server that is not part of the same domain
http://www.php.net/manual/en/book.ldap.php I actually just implemented a basic LDAP authentication script. This was my first draft of the script before I changed and messed with it to fit with my setup. This basically connects to the server, if not the scrpt is killed. Then tries to authenticate the given username and password, if not, it fails. Quick and simple. $ldapHost = "example2.com"; $ldapPort = 666; $ldapBaseDn = "ldap base dn here"; $username = "username"; $password = "password"; $ldapUserDn = "uid=$username,".$ldapBaseDn; echo "LDAP query test "; echo "Connecting ... "; $ldapConn = ldap_connect($ldapHost, $ldapPort) or die("Unable to connect to LDAP server: $ldapHost "); echo "Authenticating user ... "; $isValid = ldap_bind($ldapConn, $ldapUserDn, $password) or d

Categories : PHP

SignalR cross-domain without CORS
If cors is not available SignalR uses longPolling transport with jsonp. Keep in mind jsonp is insecure by design AND can limit your data you send over the wire since all data is sent via the query string. You should not have to provide any additional information on the client for SignalR to use jsonp, it should just work. To ensure that cross domain communication works on the server you'll have to enable it: Routes.RouteTable.MapHubs(new HubConfiguration { EnableCrossDomain = true });

Categories : Asp Net

WebDAV Server Error 401.2, connection issue with Windows Authentication after pausing virtual server/domain controller
We figured out what was causing our issue although I may not be able to explain entirely why it mattered. In IIS there is a setting in the "HTTP Response Headers" under "Set Common Headers" called "Enable HTTP keep-alive". We check marked this option as true and our Windows Authentication started working again. It seemed to have something to do with the connection not staying open between requests and the application or IIS not realizing the connection was restarted during the SYNC operation.

Categories : Iis

cross-(sub-)domain history.pushState (with CORS?)
I think Bergi's point is that your server has little to do with pushState, as it never reaches the server. The only time you would touch the server is when you refreshed the page. A couple things could be happening. You are trying to test this from a local environment with a browser that doesn't support it (i.e. https://code.google.com/p/chromium/issues/detail?id=67743). You don't have your server configured to route your requests through to your index/app. Can you provide some more information on your setup?

Categories : Javascript

C# :Does Client machine need SQL Server installed on it while connecting to other machine having SQL Server installed on it (the Server machine)
The pieces needed to connect to SQL server are built into the .net framework. As long as you used those when coding the client piece you can connect to a SQL Database without MSSQL installed on the client. using System.Data; using System.Data.SqlClient; SqlClient PS: I am asking beforehand to avoid the last minute hassle on the day of installation. You should always test locally first. You can probally get your hands on a random test machine to verify that everything is good to go.

Categories : C#

Nodejs cron plugin vs running nodejs script from crontab
The main difference between the two methods in my opinion would be the level at which you want to schedule job. When using crontab your jobs are scheduled by the cron daemon that runs on the system. node-cron on the other hand is a pure JavaScript implementation of cron. So system is not responsible for running jobs but your V8 engine which executes it. Jobs will be run as long as your js application runs. So why would you use one or other ? That depends on the purpose of your job, where is it best tethered . If job is a maintenance job for system run it via crontab. If you want to run a function in node.js periodically use node-cron. If you want to run a bash script you would want to use crontab. So how you want to do it via system (bash) or JavaScript is upto you.

Categories : Node Js

Why doesn't validating my SMTP server domain name and port work when running as a service under the local system account?
Have you tried running it from a console app vs. service at the same time? Also, could you test both approaches by making a series of requests to gather some statistics? The point is that it could help isolate the issue from different factors other than different OS users like various network issues etc. Feel free to give new details after doing that, if you'll be able to find out something new or intresting.

Categories : C#

A Generic error occured in GDI+ on Server Machine
Why do you use ms.Close();,ms.Dispose(); and ms = null;? You dispose this stream twice and afterwards set it to null. Finally is performed always so MemoryStream is always disposed. I suspect that all resources are released before they're used by GDI. I experienced similar problem some time ago. According to MSDN: http://msdn.microsoft.com/en-us/library/93z9ee4x.aspx You must keep the stream open for the lifetime of the Image. The solution was a creation a Bitmap object: Bitmap bmp = new Bitmap(ms); this.pcInsurance.Image = bmp; In fact I used using statement to simplify code, closing stream before final braces. Works exactly the same but is shorter and in my opinion more readable. Bitmap and picturebox.Imageobjects must be disposed before setting another picture

Categories : C#

Using Dynamic Scripts to load JSON Data - Cross Domain - CORS not available
May be you should try $.ajax({}); instead of $.getSrript(); to do the cross domain e.g $.ajax({url: "your_url.php",dataType; "jsonp",success: function(data){ document.write(data);} });

Categories : Javascript

Cannot access ubuntu server from other machines other than the machine which is hosting the virtual machine which is my ubuntu server
First of all make sure in the setting of the virtual machine that it is in Bridged Adaptor type connectivity. Give a static ip to the virtual machine using sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0 the above is an example. You got what I mean. 3.Third, Try pinging the virtual machine with the base machine running the vbox to make sure they are connected. ping ipaddress-basemachine 4 . Now if everything is working fine from there then connect with this virtual machine with other base machine using Remote Desktop Viewer or any other similar application. Specify, the ip-address of the vbox and username, password. It will be able to connect with it now. 5 . If it still is not able to then try to check the firewall rules on both the virtual box machine and the base machine

Categories : Linux

Connecting Clients machine to MySQL Server machine
You can use other tool with good looking GUI. For example: HeidiSQL. Then, you need to enable remote access. If you use windows, there is nice wizard for you to enable remote access with a few clicks. The wizard is located it at MySQL Server 5.5inMySQLInstanceConfig.exe. Then Reconfigure Instance -> Next -> Standard Configuration -> Next -> Next. You will see this screen. Tick on "Enable root access from remote machines". Or you can manually configure it to allow remote access from my.ini file. See this link for how to do it. If having done above still does not allow you to connect to your MySQL. Please make sure that Firewall does not block MySQL port.

Categories : Mysql

Run nodejs command line module to output in nodejs web server?
you could have 2 node instances. One the http server and the second instance the command line instance to run jasmine. The http server instance would spawn the command line instance. Then you could register a GET route on the http server such as someexample.com/runtests which would call the tests and wait for the tests to finish and respond with the console output. This is sort of unorthodox, but there wouldn't be a direct way to run command line applications through the browser without modifying their source.

Categories : Node Js

How do I point a domain back to my own machine? (only for my own browser)
You're looking for the hosts file. It's more than likely what points localhost to 127.0.0.1 on your computer. You can find it at C:WindowsSystem32driversetchosts on Windows. Or /etc/hosts on most Linux systems, if you're interested.

Categories : Testing

domain mapping: php or nodejs & nginx
I'm assuming you own example.com, they own mappable.com, and you want to allow them to use their domain mappable.com to access your subdomain mappable.example.com hosted on your server. There are a few steps you'll need to do for this. Set up wildcard DNS with your domain registrar so that all sub-domains will come to your one server. Set up wildcard domain handling in nginx's conf on your one server so that all requests are sent to your code. You can do this using an underscore as the server name to make it the default server. In your PHP code, you can check the headers to determine what domain the request is coming in through. Do a dump of $_SERVER to see what's in there. You will then know if the request came to mappable.com, mappable.example.com, etc... Once you are in PHP with th

Categories : PHP

Writing Domain Aware Functions in NodeJS
UPDATE I have done some more work on this and found a great way of writing async functions using domains that eliminates most of the exception handling boilerplate and performs better than try catch exception handling in some cases: http://www.lighthouselogic.com/using-a-new-domain-for-each-async-function-in-node/ This supersedes much of what is written in the post below. In fact the function useExistingDomainifAvailable that I proposed below has side effects that I didn't consider when writing this original answer. The main one being that error handling is always done via a short circuit back to the domain exception handler rather than through the callback chain. UPDATE So, I did some performance testing and found that the domain version is actually about the same as wrapping the fun

Categories : Javascript

Error when running rails server
In your line 4 of routes.rb you should have: root to: 'static_pages#home' The error occurs because, as you see here, root method expect its parameter to be Hash while you are passing String.

Categories : Ruby On Rails

Error in running rails server
First, make sure you have mysql installed on your machine. If you have an Ubuntu distribution, try: sudo apt-get install libmysql-ruby libmysqlclient-dev then try to install the gem again.

Categories : Ruby On Rails

UserPrincipals.GetAuthorizationGroups An error (1301) occurred while enumerating the groups. After upgrading to Server 2012 Domain Controller
I'm in an environment with multiple domain forests and trusts. I have pretty much this exact same code running on a web site form used to perform user security group lookups across the different domains. I get this exact error in one of the very large domains where group membership can include 50+ different groups. It works fine in other domains forests. In my research I found a thread that looks unrelated, but actually has the same stack trace. It is for a remote application running on SBS. The thread mentions that the error is caused by unresolvable SIDS in a group. I believe these would be what are known as "tombstoned" SIDS in active directory. See the thread here. The thread suggests that finding the tombstoned enteries and removing them from the groups solves the problem. Is it

Categories : C#

add product from one domain, to the cart of different domain(both are on same server)
The requirement is that both domains have to store the sessions at the same place. Then you have to make the client use the same session id on both domains, to do that, pass the session id in all links and redirects that go from one domain to another. <a href="http://xyz.com/cart.php?<?php echo SID ?>">cart</a>

Categories : PHP

Get file contents of a domain in another domain in the same server
Glob needs file-access. But since it is on another domain. It doesn't get file-access (and it shouldn't). Even if they are on the same server, they shouldn't be able to access each others files for so many reasons. What you can do is write a small API on domain1.com that returns a list of images for a certain user. You then access that information using for isntance curl on domain1.com where the pictures are stored: <?php //get the user id from the request $user_id = $_GET['user_id']; $pathToImageFolder = 'path_to_pictures' . $user_id ; $images = glob($pathToImageFolder.'/*.{jpg,jpeg,png,gif}', GLOB_BRACE); //return a JSON array of images print json_encode($images,true); #the true forces it to be an array on domain2.com: <?php //retrieve the pictures $picturesJSON = file_get_

Categories : PHP

internal server error when running soapclient
Internal Server Error usually means the server got your request but it did not like one of the parameters. Lookin at your WSDL I can see CelciusToFahrenheit expects one parameter with this definition: <xs:complexType> <xs:sequence> <xs:element name="nCelcius" type="xs:decimal"/> </xs:sequence> </xs:complexType> A complex type is an object. So try this: $SoapCallParameters = new stdClass(); $SoapCallParameters->nCelcius = 30; $obj = $client->CelciusToFahrenheit($SoapCallParameters);

Categories : PHP

Can I use the Integrated Security option in a connection string if I'm connecting to a remote machine that's not on a domain?
Integrated security will only work when the machines are on the same domain (or a different domain with a trust) this is because SQL server has to contact a domain controller to authenticate a windows logon, which it can only do if it is a member of a domain. Just being connected to the LAN is not enough as although the machine may be able to physically connect to the domain controller, it will not be able to authenticate users against it.

Categories : Sql Server

Internal server error 500 after 90 seconds of PHP script running
In hope to save other people's hair (I pulled out pretty much of my own on this one) The solution is to increase the FastCGI activity timeout. Use appcmd, the IIS 7 command line tool, to modify the IIS configuration XML file. Run cmd in an administrator mode. To check the current settings use: %windir%system32inetsrvappcmd list config -section:system.webServer/fastCgi To add the activity timeout (assuming CGI location is C:phpphp-cgi.exe): %windir%system32inetsrvappcmd set config -section:system.webServer/fastCgi /[fullPath='C:phpphp-cgi.exe'].activityTimeout:600 This output now should be similar to this: - <system.webServer> <fastCgi> <application fullPath="C:PHPphp-cgi.exe" activityTimeout="600" instanceMaxRequests="10000"> <environmentVariables> <env

Categories : PHP

Getting 500 - Internal server error. while running the azure project
Basically, your application is throwing an unhandled error. You will want to know what the real error is, as Error 500 is just a generic way of saying: something happened. You can deploy your app with customerrors being OFF so you can actually see the real error (Check this link for sample instructions: http://www.serverintellect.com/support/programming/custom-errors.aspx ). Alternatively, if you're using WebRoles, you can RDP into a server instance and check Windows EventViewer, the details of the error will likely show up there.

Categories : Asp Net

Client-Server Program: Client can connect to server easily but server can't respond cause target machine actively refuses connections
You need to design your client and server so that the client-to-server connection remains open to recieve the responce and then do something like this: public static bool sendTo(IPEndPoint ip, String data) { TcpClient client = null; NetworkStream stream = null; StreamWriter writer = null; StreamReader reader = null; try { client = new TcpClient(); client.Connect(ip); stream = c.GetStream(); writer = new StreamWriter(stream); writer.WriteLine(data); writer.Flush(); reader = new StreamReader(stream); string response = reader.ReadLine(); if (response == "roger-alpha-tango") { return true; } } catch { return false; } finally { i

Categories : C#

System.Web.Http.Cors: How to disable CORS request for a Web Api method
For a simple HTTP requests (basically GET and POST with form-url-encoded) the request still executes on the server, but the client is not allowed access to the results. CORS (in this scenario) only indicates back to the browser if the client is allowed to consume the results.

Categories : Asp Net Web Api

Cross domain error even when ajax called made from same domain
Have you tried setting alternate HTTP header values when your service returns data: Access-Control-Allow-Origin:* Access-Control-Allow-Headers:"Content-Type, X-Requested-With, X-Auth-Token" This worked for us when trying to make REST calls to services under different sub-domains. You don't have to make Access-Control-Allow-Origin: * you can probably be more restrictive. But we tried this just to check if it will work. Just to clarify - we still use json and not jsonp

Categories : Jquery



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