Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUERY_STRING not returning expected data using windows 64 bit executable #63

Closed
kjwise opened this issue May 14, 2014 · 8 comments
Closed

Comments

@kjwise
Copy link

kjwise commented May 14, 2014

Only tested against 64 bit websocketd

Create a .cmd file with following:

@echo off
setlocal EnableDelayedExpansion
@echo %PATH%
@echo %QUERY_STRING%
@echo %SERVER_NAME%
@echo %GATEWAY_INTERFACE%

Service with websocketd, use count.html example to connect and display the result.
Use url like for example: file:///C:/temp/websocketd/count.html?asfds=foo&bar=loo

Expected:
CONNECT
MESSAGE: c:...; ...
MESSAGE: asfds=foo&bar=loo
MESSAGE: localhost
MESSAGE: websocketd-CGI/0.1
DISCONNECT

Got:
CONNECT
MESSAGE: c:...; ...
MESSAGE: ECHO is off.
MESSAGE: localhost
MESSAGE: websocketd-CGI/0.1
DISCONNECT

@asergeyev
Copy link
Collaborator

Thanks!
Interesting issue... I'll need to find windows VM to try that somehow. Are you able to install go and compile latest websocketd ?

@asergeyev asergeyev added the bug label May 14, 2014
@asergeyev
Copy link
Collaborator

Can you take a look at REQUEST_URI, does it include "?asfds=foo&bar=loo" or no?

@kjwise
Copy link
Author

kjwise commented May 14, 2014

I used the provided downloadable binary from here.

Using REQUEST_URI:

CONNECT
MESSAGE: /
MESSAGE: localhost
MESSAGE: websocketd-CGI/0.1
DISCONNECT

Contents of the .cmd file:
@echo off
setlocal EnableDelayedExpansion
@echo %REQUEST_URI%
@echo %SERVER_NAME%
@echo %GATEWAY_INTERFACE%

@asergeyev
Copy link
Collaborator

I checked that with windows 32 bit and binary from website and things work fine with it....
I can see correct REQUEST_URI and QUERY_STRING... Will still look for 64 bit windows vm....

@asergeyev
Copy link
Collaborator

Well.. Same thing on 64 bit for me, I cannot confirm it...
15 05 2014 194351

@asergeyev asergeyev removed the bug label May 15, 2014
@kjwise
Copy link
Author

kjwise commented May 16, 2014

Interesting, I'm running native windows 7 but that shouldn't matter.
I'm going to take a further look, in the meantime:

C:\temp\websocketd>websocketd --version
websocketd 0.2.8

C:\temp\websocketd>ver

Microsoft Windows [Version 6.1.7601]

@kjwise
Copy link
Author

kjwise commented May 16, 2014

Hah, peg this as a user error.

The query string has to be sent via the ws socket for the server to get the data. My example was based off on the query string passed over http to a certain script...

Perhaps a small note like "Ensure your querystring is being passed over the websocket if you intend for its values to be readable through this environment variable" would prevent other after-programming tinkering-at-home hackers to do the same mistake as I did.

My apologies.

@kjwise kjwise closed this as completed May 16, 2014
@asergeyev
Copy link
Collaborator

No worries, glad it was easy to resolve :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants