Bug #5666
closedipv6 not working
0%
Description
I'm attempting to get a standalone WT server known to work on IPv4 to work on IPv6. I'm using wt 3.3.6 libs. I changed the ---http-address to 0::0 and connected over IPv6. My WT server is seeing hundreds of sessions being started every minute from a single browser. I'm using URL in the config file to track sessions. I've tried with and without websockets. Server info logs contain the following.
[2017-Apr-14 21:21:08.895082] 24800 - [info] "WebRequest: took 0.309ms"
[2017-Apr-14 21:21:08.896553] 24800 - [info] "Wt: session created (#sessions = 1619)"
fe80::9091:a6f9:c59b:e6dc%eth0 - - [2017-Apr-14 21:21:08.897269] "OPTIONS /ljaudioWidget?div=ljaudio&_=1492203087006 HTTP/1.1" 200 0
[2017-Apr-14 21:21:08.897316] 24800 - [info] "WebRequest: took 0.874ms"
[2017-Apr-14 21:21:08.898342] 24800 - [info] "Wt: session created (#sessions = 1620)"
fe80::9091:a6f9:c59b:e6dc%eth0 - - [2017-Apr-14 21:21:08.898970] "OPTIONS /ljaudioWidget?div=ljaudio&_=1492203087007 HTTP/1.1" 200 0
[2017-Apr-14 21:21:08.899002] 24800 - [info] "WebRequest: took 0.765ms"
[2017-Apr-14 21:21:08.900137] 24800 - [info] "Wt: session created (#sessions = 1621)"
fe80::9091:a6f9:c59b:e6dc%eth0 - - [2017-Apr-14 21:21:08.900581] "OPTIONS /ljaudioWidget?div=ljaudio&_=1492203087008 HTTP/1.1" 200 0
[2017-Apr-14 21:21:08.900610] 24800 - [info] "WebRequest: took 0.56ms"
Over IPv4 it looks as follows
[2017-Apr-14 21:33:23.096414] 3295 - [info] "Wt: session created (#sessions = 1)"
[2017-Apr-14 21:33:23.096652] 3295 [/ljaudioWidget vfk0aVsf3EqhGZiG] [info] "WEnvironment: UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36"
192.46.110.174 - - [2017-Apr-14 21:33:35.920960] "POST /ljaudioWidget?wtd=vfk0aVsf3EqhGZiG&wtt=widgetset HTTP/1.1" 200 111
Updated by Roel Standaert over 7 years ago
- Status changed from New to Feedback
I can't seem to reproduce this (I tested the widgetset mode example with the latest master). How are you connecting to the server? What IP addresses are used for which interface on server and client and what are you entering in the address bar to navigate to the server?
Updated by mat Sch over 7 years ago
Thanks Roel,
I'm sourcing the widget in javascript using ajax. The address that i'm using is http://[fe80::201:29ff::fe22:c353]:81/ljaudioWidget?div=ljaudio
Thanks,
-mat
Updated by Roel Standaert over 7 years ago
- Assignee set to Roel Standaert
The OPTIONS
request seems to suggest that your browser is identifying the request as a pre-flighted request, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests.
Could it be that your request does not meet the conditions of a simple request for some reason? At what URL are you accessing the page that the widget is embedded in?
It would help if you could send a HAR file with all of the network requests. You can do this in Firefox by opening the network tab (Ctrl+Shift+Q) before making your requests, right-clicking on the result and choosing "Save all as HAR". In Chrome, open the developer tools (Ctrl+Shift+I) and go to the network tab. Right-click and "Save as HAR with Content".
Regards,
Roel
Updated by mat Sch over 7 years ago
It looks like it is related to CORS and the browser checking the policy before sending the request. The page is loaded from port 80 and the wt server is on port 81 so I suppose it is cross site. This works fine for IPV4 but when I switch it to a IPV6 address then it looks like the request is not handle.
The request from a network capture is posted below. The wt server doesn't respond. The following is repeated like 1000/second. Each request looks to start a new wt session.
Thanks,
-mat
OPTIONS /ljaudioWidget?div=ljaudio&_=1495825080090 HTTP/1.1
Host: [fe80::201:29ff:fe22:c353]:81
Connection: keep-alive
Access-Control-Request-Method: GET
Origin: http://[fe80::201:29ff:fe22:c353]
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
Access-Control-Request-Headers: x-requested-with
Accept: /
Referer: http://[fe80::201:29ff:fe22:c353]/client/mw/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Updated by Roel Standaert over 7 years ago
Wt does not seem to support CORS for new sessions. Wt only allows it if there's an existing wtd.
I think the X-Requested-With header is causing the request to be preflighted, because simple GET requests shouldn't be. I guess you're using a jQuery or something like that? I think that it should work if you use a plain XMLHTTPRequest instead. There are also snippets to be found that are supposed to remove X-Requested-With, e.g.: https://stackoverflow.com/a/24719409/2625232.
Updated by Roel Standaert about 7 years ago
- Status changed from Feedback to Closed
This should be fixed with the 3.3.8 release, see the bit about CORS in the release notes: http://www.webtoolkit.eu/wt/wt-3.3.8/doc/reference/html/Releasenotes.html