Comments (10)
Hi @moxgeek ,
Thanks for the update!
I just released the patch as part of the iodine 0.7.18 release.
Thanks for exposing the issue. Your name is now engraved into facil.io's changelog.
FYI: the GitHub master branch is the development branch. It always has the latest bug fixes... but I also break it sometimes while tinkering.
Cheers!
from plezi.
I apologize. This is a documentation issue that references an old version of iodine.
I’ll take care of it when I’m by my computer.
For now, please make sure you have the latest version of iodine installed and run iodine -?
to get a list of command line options.
I recommend that you use these options to adjust any runtime options rather than hard-code these settings to your app.
Kindly,
Bo.
from plezi.
Possibly related to fix in version 0.7.17:
fixed CLI argument recognition for WebSocket message limits and HTTP header limits. Typos in the CLI argument names prevented the CLI from effecting the default values.
from plezi.
P.S.
Please notice that the Iodine::DEFAULT_SETTINGS[:max_msg]
is in Kb (same as iodine -maxms ...
).
For 4Mb you need 4096 Kb, which (unless I have a bug somewhere) should translate as:
bundle exec iodine -v -maxms 4096 -t 16 -w 20 -www ./public
Also, this limit is only relevant for incoming data. It's a security measure that protects the server against a malicious client sending huge amounts of data as a type of Slowloris WebSocket DoS attack.
Outgoing data is unlimited in size, although I do recommend fragmenting large data (or the client might be overwhelmed).
from plezi.
Also, this limit is only relevant for incoming data ... Outgoing data is unlimited in size
that's weird , i'm facing this problem with sending data from server to the client ...
the client receives an error when trying to get a bigger data : failed: Invalid frame header
with js and java client.
from plezi.
Hi @moxgeek
I can't recreate the issue. This is the code I used to send up to 32Mb of data (iodine version 0.7.17):
require 'iodine'
class Client
def on_open client
messages = []
messages << ("a" * 16)
messages << ("a" * 1024)
messages << ("a" * (1024 * 1024))
messages << ("a" * (4 * 1024 * 1024))
messages << ("a" * (6 * 1024 * 1024))
messages << ("a" * (32 * 1024 * 1024))
Iodine.run_every(500, messages.length) { client.write messages.shift; client.close if messages.empty? }
end
def self.call env
# check if this is an upgrade request.
if(env['rack.upgrade?'.freeze] == :websocket)
env['rack.upgrade'.freeze] = Client.new
[200, {}, []]
end
# simply return the RESPONSE object, no matter what request was received.
[200, {}, "Ok"]
end
end
Iodine.listen url: "http://:3000", handler: Client
Iodine.threads = 1
Iodine.start
Which version of iodine are you running? Are you sending text of binary data? if text, is the text valid UTF-8 encoded (if not, the browser will complain)?
Kindly,
Bo
from plezi.
thanks for your feedback
i'am using 0.7.17 iodine
but what i'am doing is nothing to do with the example you share
class ExampleCtrl
CHANNEL = "User"
# HTTP
def index
# any String returned will be appended to the response. We return a String.
"render"
end
def new
'Should we make something new?'
end
# called when request is POST or PUT and params['id'] isn't defined or params[:id] == "new"
def create
"Hit the road jack ... no more no more no more"
end
# called when request is POST or PUT and params['id'] exists and isn't "new"
def update
end
# Websockets
def on_open
userid = params['id']
subscribe "ALL"
subscribe CHANNEL+userid.to_s
data = HEREISMYBIGSTRING
puts data # i do this to verify if i have it on my memory and it's work
puts CHANNEL+userid.to_s # i verify the channel number
publish CHANNEL+userid.to_s, data
end
def on_message(data)
end
def on_close
userid = params['id'.freeze]
publish CHANNEL+userid, "#{@handle} left us :-("
end
end
Plezi.route '/getdata', ExampleCtrl
it's work fine for any message , but not big sized one ( less then 1mb)
from plezi.
Perfect, thanks! Now I can reproduce the issue.
As a temporary workaround try:
# for text messages
subscribe(CHANNEL+userid.to_s) {|ch, msg| msg.encode!("UTF-8"); write msg }
# # OR for binary messages
# subscribe(CHANNEL+userid.to_s) {|ch, msg| write msg }
This will circumvent the pub/sub WebSocket encoder where the bug is likely hiding.
I'll try to fix it in the next few days.
from plezi.
I think I found and fixed the issue.
Any chance you could install iodine from the GitHub repo and confirm that tissue is solved?
Thanks!
Bo.
from plezi.
cheers mate ! working fine .
maybe replacing gem iodine at Gemfile with
gem 'iodine' , git: 'https://github.com/boazsegev/iodine'
will be good to future users .
thanks again .
from plezi.
Related Issues (20)
- ERROR -- : uninitialized constant OpenSSL::SSL::SSLErrorWaitReadable (NameError) HOT 10
- ERROR -- : incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError) HOT 11
- Documentation help needed. HOT 2
- WebSocket connection to 'ws://localhost:3000/ws' failed: Error during WebSocket handshake: Unexpected response code: 200 HOT 21
- JSON event length is limited HOT 10
- Server configs HOT 4
- download error with bundled client.js HOT 1
- rabbitmq HOT 1
- Finding a websocket session and send message HOT 8
- SyntaxError in generated config.ru
- Rack < 2.0 : cannot load such file -- rack/query_parser.rb HOT 1
- create function is not synchronized HOT 19
- server shutdown when one or more client has a poor connection HOT 7
- Upgrade to bundler 2.0 HOT 3
- Help needed! HOT 1
- Failing at higher concurrency HOT 2
- Gap in documentation for serving static assets HOT 3
- Architectural clarification HOT 2
- There is no way to unsubscribe from Plezi::Controller.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plezi.