mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 07:08:08 +00:00
Add uri_root_path option. References #104.
This commit is contained in:
@@ -36,7 +36,11 @@ document.addEventListener 'DOMContentLoaded', ->
|
||||
else
|
||||
wsUrl = 'ws://'
|
||||
|
||||
wsUrl += document.location.host + '/ws' + location.pathname
|
||||
root_path = document.body.getAttribute('data-root-path')
|
||||
if root_path.length
|
||||
root_path = "/#{root_path}"
|
||||
|
||||
wsUrl += document.location.host + root_path + '/ws' + location.pathname
|
||||
ws = new WebSocket wsUrl
|
||||
|
||||
ws.addEventListener 'open', ->
|
||||
|
||||
Reference in New Issue
Block a user