We propose and demonstrate an on-chip optofluidic device allowing active oscillatory microrheological measurements with sub-μL sample volume, low cost and high flexibility. Thanks to the use of this optofluidic microrheometer it is possible to measure the viscoelastic properties of complex fluids in the frequency range 0.01-10 Hz at different temperatures. The system is based on the optical forces exerted on a microbead by two counterpropagating infrared laser beams. The core elements of the optical part, integrated waveguides and an optical modulator, are fabricated by fs-laser writing on a glass substrate. The system performance is validated by measuring viscoelastic solutions of aqueous worm-like micelles composed by Cetylpyridinium Chloride (CPyCl) and Sodium Salicylate (NaSal).